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

to much useless data received with UART, what doing??

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







to much useless data received with UART, what doing??
PostPosted: Fri Jun 20, 2008 1:06 am     Reply with quote

hello,
I have a problem with a pic 16f876a and a gps

on start the gps is at 115200bps and 5 trames/s and I need to change setting for it become 4800bps and 1 trames/s .

I now how to do that but the time that I change its setting, the pic has received to much data on uart and stop.

can I stop to receive data during 2s? or can I reset uart to avoid over flow?

thanks for your help and sorry for my bad english

spilz
Ttelmah
Guest







PostPosted: Fri Jun 20, 2008 2:05 am     Reply with quote

Add the 'ERRORS' directive to your #use RS232 definition.
Once you have sent the initialisation string to the modem, add a simple loop to flush the couple of characters that the UART can hold. So:
Code:

while (kbhit()) getc();

The ERRORS directive, will make this also clear the overrun flag, which will otherwise lock up the UART.

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