View previous topic :: View next topic |
Author |
Message |
psyonic
Joined: 03 May 2007 Posts: 2
|
RS232 - 18F458 |
Posted: Tue May 08, 2007 12:06 pm |
|
|
Why this code send without stop the word "MESSAGE", when i send a char by the serial?
#use delay(clock=40000000)
#use rs232( baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8 )
set_tris_C(0b10000000); // CONFIGURA A PORTA
while(1) {
while(!kbhit());
printf(" MESSAGE ");
}
i solved
while(1) {
while(!kbhit());
getc();
printf(" MESSAGE ");
}
it is necessary to clean the register, to do it the function "getc()" can be used
thks |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue May 08, 2007 1:41 pm |
|
|
Check the hardware connections to the Rx pin on your PIC (pin C7).
Make sure it's really connected to the output of a receiver section on
your MAX232-type chip. Make sure pin C7 isn't accidently being held
at a constant low level. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Tue May 08, 2007 9:04 pm |
|
|
thanks, but the problem was on the code |
|
![](templates/subSilver/images/spacer.gif) |
|