CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RS232 - 18F458

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
psyonic



Joined: 03 May 2007
Posts: 2

View user's profile Send private message

RS232 - 18F458
PostPosted: Tue May 08, 2007 12:06 pm     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 08, 2007 1:41 pm     Reply with quote

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.
Guest








PostPosted: Tue May 08, 2007 9:04 pm     Reply with quote

thanks, but the problem was on the code
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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