Missing bytes with UART and ringbuffer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Missing bytes with UART and ringbuffer

606 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by remcopoelstra on Sun Aug 31 07:16:13 MST 2014
Hi,

I've based my code on the UART ringbuffer example to send and receive bytes (almost an exact copy).
I'm missing lots of bytes though.
Sometimes a few get through, sometimes even about 100. But in the end I always miss bytes.
The Ringbuffer_GetCount simple tells me it's empty.
How reliable is the ringbuffer+uart combination?
Can the ringbuffer handle being fed by the interrupt handler while also being interrogated from the main loop?

Regards,

Remco Poelstra
Labels (1)
0 Kudos
1 Reply

511 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by remcopoelstra on Mon Sep 01 12:00:04 MST 2014
I found out that the USART0 reports an overrun.
It's good to know that the bytes have reached the hardware, but it's a bit strange that an overrun can happen though. I've only a single interrupt source and it's the USART0 interrupt. The RXRDY interrupt never gets disabled (only the TXRDY interrupt is disabled by the chip library).
How can it possibly happen that any byte is missed? My understanding of an interrupt is that it has priority over my main loop.
Is that assumptions correct for the LPC800?

Kind regards,

Remco Poelstra
0 Kudos