to much useless data received with UART, what doing??
Posted: Fri Jun 20, 2008 1:06 am
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
Posted: Fri Jun 20, 2008 2:05 am
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.
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