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

Serial Input

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







Serial Input
PostPosted: Fri Dec 08, 2006 7:56 am     Reply with quote

Please forgive me if this is out of scope. I'm new to C and to CCS coming over from PicBasic Pro. I have some code I have to move over and the item getting me the most is trying to come up with an equiv, routine for PBP's HserIn command.

This command will allow my to specify a Timeout period to wait for a string and I can specify the number of characters to wait for. For my needs, I need to do this..

Wait for 8 arriving characters for up to 30ms
If they don't come, then go to a timeout procedure
If they do come, drop down into the rest of the code.

Nbr=8
HSerIn 30, Mytimeout,[STR Buffer\Nbr]

What the above does is waits to recieve 8 chars for 30ms fromt he hardware USART.

If it timesout it goes to the Mytimeout routine
If they do come, it puts them into Buffer

Thanks in advance for suggestions.
Richard
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Dec 08, 2006 9:11 am     Reply with quote

Hi Richard,

CCS already has an example that implement a timed getc.
You will find it in your PICC\Examples folder: EX_TGETC.C

Regards,

Humberto
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