Quote:
As far as I know DEFINE HSER_CLROERR 1 (for the second USART it's DEFINE HSER2_CLROERR 1) is available in PBP2.x as well. But, remember that it only "works" when you're actually using HSERIN, if you "drive" the USART manually (like when you do DAT_IN1 = RCREG1) it won't do anything and you'd need to check/clear the overrun flag manually. It all it does is clear the overrun error flag (if set), it won't do anything to actually prevent the overrun condition in first place.
Overruns aren't really a problem, except when that condition locks up the device. More importantly, you pointed out something I never caught onto. So there is a HSER@2_CLOERR 1 define.
Quote:
The main issue here is most likely the overall structure of the program. The data needs to be read from the USART buffer before the next byte comes in, the "best" way to handle this (if you don't know when data is about to come in) is usually to use interrupts. I don't know how you're handling it in your program (I may have missed it).
I use HSERIN/HSERIN2 to get all data and I use interrupts to get it. If I understand your post correctly, I can remove this: