On Tue, 19 Sep 2006, Phillip wrote: > I am testing to see if the bit is set. > I don't believe it should be set. > I think this condition is bogus or the hardware is lying......I know it > sounds even crazier if I say it out loud. The hardware isn't lying. If the bit is set, you're getting an overrun. You should not even consider any other possibility. > Even if it is not I don't see why I need to clear the darn thing even if it > is set. > So what I got a bad character....who cares? An overrun doesn't mean a bad character; it means you've failed to read the data from UART and the UART receive FIFO filled. > How does the over run prevent further interrupts from occurring? It doesn't directly prevent interrupts. When an overrun occurs, data is no longer transferred to RCREG. > Where is it written that if there is an error on a USART that interrupts are > now stopped forever? In the datasheet: "The RCREG is a double-buffered register (i.e., it is a two-deep FIFO). It is possible for two bytes of data to be received and transferred to the RCREG FIFO and a third byte begin shifting to the RSR register. On the detection of the STOP bit of the third byte, if the RCREG register is still full, overrun error bit, OERR, will be set. The word in the RSR will be lost. The RCREG register can be read twice to retrieve the two bytes in the FIFO. The OERR bit has to be cleared in software. This is done by resetting the receive logic (the CREN bit is cleared and then set). If the OERR bit is set, transfers from the RSR register to the RCREG register are inhibited, so it is essential to clear the OERR bit if it is set." > I thought the whole idea of having those errors was so that you could drop a > character without having to process it or maybe as an aide to be able to > work out the baud rate on the fly. Overruns are not caused by bad characters. They are caused by software bugs. -- John W. Temples, III -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist