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 support@ccsinfo.com

Polling for information

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







Polling for information
PostPosted: Sat Apr 29, 2006 6:55 pm     Reply with quote

I have a camera and it is connected to a pic via serial TTL running at 11200 baud (or something like). The action of the pic depends on the data comming from the camera. If I poll the camera for information, would that slow down my pic running at 40mhz because the serial TTL is running at 1120?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Apr 29, 2006 11:51 pm     Reply with quote

It's best if you use an interrupt-driven receive buffer, such as the one
shown in the CCS example file, EX_SISR.C. If you set the buffer size
at some reasonably large number of characters, then it gives you time
to go do something else in your program while the INT_RDA isr takes
care of handling incoming characters. Just periodically test "bkbhit"
to see if you have any chars in the buffer. If so, then call bgetc() to
pull them out of the buffer. You do have to check bkbhit often enough
so that you don't get buffer overflow and lose chars.
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