View previous topic :: View next topic |
Author |
Message |
ljb
Joined: 19 Nov 2003 Posts: 30
|
serial port hangs on 16f876 |
Posted: Mon Jul 19, 2004 7:10 am |
|
|
I'm using the serial h/w port on 16f876.
The port hangs if char are rx'ed to fast. (seems about 3 or 4 char, so I'm wondering if it is something to do with the buffer).The rest of the s/w is still running.
Can anyone tell me what is happening and better still how to over come it.
Many thanks
Les |
|
|
Birdie Guest
|
|
Posted: Mon Jul 19, 2004 9:43 am |
|
|
I had a similar problem with PIC18F6720 and the following helped prevent lock-ups:
//Check for receive buffer overrun error and clear if error.
if(bit_test(*RCSTA1, OERR))
{
bit_clear(*RCSTA1, CREN);
bit_set(*RCSTA1, CREN);
}
Hope this leads to a solution. |
|
|
lucky
Joined: 12 Sep 2003 Posts: 46 Location: South Coast - England
|
RS232 Hang |
Posted: Mon Jul 19, 2004 10:15 am |
|
|
If the 3 Byte H/W buffer is over run then the RS232 will hang until the error is cleared.
You can include the ERRORS option in your #use_rs232 statement to automaticly clear these errors as they occour. It will also copy the errors into a variable that you can then read. _________________ Lucky
www.mpic3.com - MPIC3 player project, Forum, Downloads, Online Shop |
|
|
|