EmbeddedRelated.com
Forums

Serial driver - abandon FIFO data on error?

Started by Chris Carlen June 9, 2008
Jim Granville wrote:
> Chris Carlen wrote: >> Jim Granville wrote: >> >>> Chris Carlen wrote: >>> >>>> >>>> What is typically done in UART drivers with the contents of the hw >>>> FIFO when an overrun is detected? >>> >>> >>> My understanding is that the better HW FIFO UART designs have a >>> 'wider fifo' that includes the error flags, for each byte. The errata >>> I have seen as well, indicates they do not always get the tracking of >>> those flags quite right! >>> >>> So, I would say 'best practise' would be to implement a similar SW >>> scheme: >>> slightly more work, but it gives much more info for fault anaylsis, and >>> as you indicate, works better by discarding less data. >> >> >> I'm not writing a software UART, just a software buffer extension of a >> hardware UART with 16-byte FIFO. When an overrun error occurs, know >> that it occured after the 16 bytes in the FIFO. Any other error (FE, >> PE) I have no idea to which character it pertains since it is possible >> that I don't get into the interrupt routine until several chars have >> been queued. That is because the RX ISR will need to be preemptable >> by other much more time critical interrupts in a real-time controller. > > So, this device has a HW CHAR fifo, but not an HW Flag/error fifo ? > - seems to have not caught up with the better uart designs... ?
It took me a while to figure out the functionality of two bits in a register (the documentation can be a bit vacuous). Indeed, the F2812 tracks framing and parity errors for each char in the FIFO. There are two bits: SCIRXBUF.SCIFFFE and SCIFFPE which reflect the status of the character at the top of the FIFO (the one you are about to read from SCIRXBUF.RXDT). There are also a set of error bits for FE, PE, etc., which just latch whenever an error is detected. I had thought the SCIFFFE and SCIFFPE were redundant with these (and wondered why) until I figured out that these two track the error status of the top FIFO char. -- Good day! ____________________________________ CRC crobcREMOVETHIS@BOGUSsbcglobal.net NOTE, delete texts: "REMOVETHIS" and "BOGUS" from email address to reply.