PDA

View Full Version : serin buffer overflow



Chirpy
- 25th February 2013, 00:23
hey, Ive been curious about something for a while, but Ive used hser for various projects due to this reason, but sending a long stream of chars to the PIC usually causes it to lock up. I use a 16f628a and if I use serin, it'll lock up after a second or two, but with hserin, I can add this to the top of my code and it prevents this situation from occurring:


define HSER_CLROERR 1

I was just curious if there was anything in serin/serin2 that is like this. Im still using pbp 2.6 I believe, havnt checked in ages :p but cant afford to upgrade to 3.x

rayzrocket
- 9th December 2013, 06:57
I believe that DEFINE is only good for the hardware serial port, not the serin/serin2 software serial port implementation.
The Hardware serial ports on PIC have the OERR bit in the RCSTA register that gets set if there is a overun issue in the 'hardware' serial port.
This has nothing to do with software serial port use such as serin.