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 tx rx enquiry

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







PostPosted: Sat Nov 05, 2005 5:27 am     Reply with quote

You are running off the 'end' of the main, in the transmit program.
This is a 'key' difference between the 'embedded' C, and normal C. In a normal C program, the 'main' is called by the OS, and when it ends, the computer returns to the OS, and any outstanding jobs will be finished. With the embedded C, the 'main' is all that exists, and if you drop off the end, you hit a hidden 'sleep' instruction, which prevents the code running over the whole of memory, but also stops anything else from happening. The 'printf', transfers the characters to the hardware buffers in the chip, and will return, when only one character has transferred. At this point, the code runs off the end of the program, and the UART stops.
If you look at posted examples, you will find 'traps' added at the end of the main, to avoid this. Typically:

while(TRUE) ;

Best Wishes
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