overrun errors that never go
I think you have to read the register twice then turn it off then turn it back on.
eg.

        movf    RCREG,w                 ; read twice

        movf    RCREG,w                 ; read character 

        bcf     RCSTA,CREN              ; turn reception off

        bsf     RCSTA,CREN              ; turn it on again

Regards

Stuart O'Reilly

-----Original Message-----
From: Charles Garcia-Tobin <charles.garcia-tobin@CREATURELABS.COM>
To: PICLIST@MITVMA.MIT.EDU <PICLIST@MITVMA.MIT.EDU>
Date: Tuesday, February 08, 2000 6:08 AM
Subject: overrun errors that never go



Hi there

         I am having a major headache with comms and I need some help. I am using a pic16c76 coupled with a radiometrix wireless rs232, after the random-th overrun error, no amount of receiver resetting seems to get rid of it. The program runs fine for a while. Then I obtain an overrun error. On receive interrupt I attempt to clear the overrun as follows:

        bcf     RCSTA,CREN              ; turn reception off
        movf    RCREG,w                 ; read twice
        movf    RCREG,w                 ; read character
        bsf     RCSTA,CREN              ; turn it on again

I've tried other varieties such as nops in the middle instead of reads. I even run the same code if the overrun error bit is set on a timer overflow, to reset the receiver. Tracing through the code with an ICEPIC is interesting because as soon as the receive logic is turned back on (CREN is set high again) the overrun bit goes high again!! 

        We have tested the hardware with an oscilloscope and data packets are definitely arriving at the RX pin of the pic.

        Hope you can help

                Charles.

////////////////////////////////////////////////////////////////////////
///////
// Charles García-Tobin
// Research Scientist
// Cyberlife Technology Ltd
////////////////////////////////////////////////////////////////////////
//////