|
|
View previous topic :: View next topic |
Author |
Message |
rwskinner Guest
|
Serial Input |
Posted: Fri Dec 08, 2006 7:56 am |
|
|
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
|
|
Posted: Fri Dec 08, 2006 9:11 am |
|
|
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 |
|
|
|
|
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
|