|
|
View previous topic :: View next topic |
Author |
Message |
Guest
|
5V uart hardware |
Posted: Thu May 28, 2009 7:53 pm |
|
|
I just buy this hardware and I don't know how to connect. This hardware working at 5V, UART and TTL level. Only four pin, there is Rx, Tx, Ground and 5V.
I try to connect using MAX232 but it is not working. My PIC is working well with hyperterminal. Should I connect this hardware direct to PIC? or other way? and how to command in rs232...
Thanks for any expertise |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
Re: 5V uart hardware |
Posted: Thu May 28, 2009 11:24 pm |
|
|
Anonymous wrote: | I just buy this hardware and I don't know how to connect. This hardware working at 5V, UART and TTL level. Only four pin, there is Rx, Tx, Ground and 5V. |
What hardware? Post a link to the hardware. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Sun May 31, 2009 11:14 am |
|
|
Can you tell us the signal voltage when the line is idle, and the voltage when the a data bit is active? Also giving us a link to the hardware datasheet would be ideal. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
azHer
Joined: 01 May 2008 Posts: 7
|
|
Posted: Mon Jun 01, 2009 11:22 pm |
|
|
This is the hardware link.
http://www.stronglink.cn/english/sl015m1.htm
When I powered 5V to this hardware all pin Rx and Tx are 5V.
I try this code but it's no work. It just stop after display Hex number
Code: | #include <16F877A.h>
#fuses HS,NOWDT,PUT,NOPROTECT,BROWNOUT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, STREAM=PC, ERRORS)
#use rs232(baud=9600, xmit=PIN_B1, rcv=PIN_B2, STREAM=RFID, ERRORS)
#include <flex_lcd.c>
#define cardSta PIN_B5
char GetID[4] = {0xBA,0x02,0x01,0xB9};
int8 ctr;
char rbuff[10];
//============================
void main()
{
char c;
lcd_init();
fprintf(PC,"Touch Your Card\n\r");
while(1){
if(input(cardSta)==0){
fprintf(PC,"card detected\n\r");
for (ctr=0;ctr<4;ctr++){
printf(lcd_putc,"%X",GetID[ctr]);
delay_ms(1000);
}
for (ctr=0;ctr<4;ctr++){
fprintf(PC,"%X",GetID[ctr]);
delay_ms(1000);
}
[b]// start here it's no work[/b]
for (ctr=0;ctr<4;ctr++) {
fputc(GetID[ctr],RFID); //send command to get ID
}
for (ctr=0;ctr<10;ctr++) {
rbuff[ctr]=fgetc(RFID); //receive 10 response byte
}
for (ctr=0;ctr<10;ctr++) {
fprintf(PC,"%X", rbuff[ctr]);
}
}
else{
fprintf(PC,"card not detect\n\r");
delay_ms(3000);
}
}
} |
Other example is here, using other uC:
http://narong.ee.engr.tu.ac.th/microlab/doc/rfid/
Plz help (I have no basic on C and PIC) just learn from this forum. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Jun 02, 2009 2:37 am |
|
|
TTL level UART clearly has to be connected to PIC UART pins directly. And of course, the signals have to be cross wired input to output. A MAX232 can possibly damage a connected TTL level hardware. However, with a correct connection and functional hardware, there may be other problems as well, e.g. an incorrect baud rate selected. |
|
|
azHer
Joined: 01 May 2008 Posts: 7
|
|
Posted: Tue Jun 02, 2009 8:41 pm |
|
|
I already ask the supplier about baud rate setting. The baud is 115,200.
I try at this baud rate with the above code, but no work. Anyone has an idea? How should I try this in other way |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Jun 02, 2009 11:32 pm |
|
|
If it's really 115k, it surely doesn't work with a software UART, as used in your code. But as far as I understood, the Mifare module has soldered jumpers to set the baud rate. You can either change it to 9k6 or must use the PIC hardware UART to access the module. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|