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

Composite PPM to UART
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
oxxyfx



Joined: 24 May 2007
Posts: 97

View user's profile Send private message

PostPosted: Thu Nov 11, 2010 4:43 pm     Reply with quote

Thank you. Now, the interesting part. If I put the 2 programs together first blinking the LED's and then run the RS232 test the led's will never blink but the characters I type will be echoed back on the serial port.
So why is the LED not blinking.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Nov 11, 2010 4:55 pm     Reply with quote

Because the getc() function waits in a loop until a character has been
received by the UART. Then it gets the character, and the program
flow moves on to the next line.

You can avoid the waiting loop if you call the kbhit() function before you
call getc(). If kbhit() returns 'True', then call getc(). If not, then don't
call it.
oxxyfx



Joined: 24 May 2007
Posts: 97

View user's profile Send private message

PostPosted: Thu Nov 11, 2010 6:22 pm     Reply with quote

Yes, I knew that. However the blinking led is before the code gets to read the getc(). The getc() is in the while loop and the blinking code is before that. I think it should be executed before the code enters into the UART section, or doesn't it?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Nov 11, 2010 6:33 pm     Reply with quote

Post the program that fails.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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