View previous topic :: View next topic |
Author |
Message |
leesing2k3
Joined: 08 Nov 2005 Posts: 28
|
Simple question about 16F628 RS232 |
Posted: Mon Nov 14, 2005 12:28 am |
|
|
I try to use other pins other than B1 and B2 to do RS232 but the data i m receiving is not correct. Izzit possible to use other pins to do RS232 or is there anything i should do to make it possible?
I have declared it correctly.
Thank you. |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
Re: Simple question about 16F628 RS232 |
Posted: Mon Nov 14, 2005 12:54 am |
|
|
leesing2k3 wrote: | I try to use other pins other than B1 and B2 to do RS232 but the data i m receiving is not correct. Izzit possible to use other pins to do RS232 or is there anything i should do to make it possible?
I have declared it correctly.
Thank you. |
You can use any I/O pins that are free. You have not given any clue as to what your problem is. Without a crystal ball there is nothing else I can suggest. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 14, 2005 12:57 am |
|
|
What pins are you using ?
Try this simple program with a terminal program running on your PC.
This program just returns the same character that was sent to it.
Substitute your pins for B2 and B1. See if it works.
If it doesn't work, then post your version of the compiler.
Code: | #include <16F628.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#use rs232(baud=9600, xmit=PIN_B2, rcv=PIN_B1, ERRORS)
//======================================
void main()
{
char c;
while(1)
{
c = getc();
putc(c);
}
} |
|
|
|
leesing2k3
Joined: 08 Nov 2005 Posts: 28
|
|
Posted: Mon Nov 14, 2005 8:52 am |
|
|
thank you very much |
|
|
|