Does the ISR_UART_RX (auto-generated) fire when the received data overflows the RX Buffer
No, it fires when there is at least one byte in the receive FIFO and transfers the data into the buffer.
Easiest would be to poll using UART_GetBufferSize() API which returns the number of bytes actually in the buffer (not the size of the buffer)
Thanks Bob -
So tell me if this is correct: each received byte triggers the ISR, and also transfers that byte into a software buffer. When I read athe data using UART_ReadRxData(), I get the most recent byte in that buffer?
Is there a way to read the receive buffer as a character array? I want to wait for 46 bytes to be received, then process those bytes, then clear the buffer and wait for the next 46 bytes.
In the data sheet for the UART I do not see a way to access the buffer as an array.
The buffer is arranged as a circular buffer. So, although it is a byte array, it is difficult to access the data as array.
When you do not want to poll as I described before, you need to write your own interrupt handler This is not too difficult when triggering on FIFO not empty.
Thanks, yes I've been modifying an example project on a DVK and I see that it works great if I just load up my own array as the data comes in. Set the UART RX buffer to 4, enable the "On Byte Received" interrupt, and then just fill up my array and keep track of how much data is in there. That's working fine so I'll stick with it.
Better use the "FIFO not empty" interrupt. Transfer from receiver to FIFO is done in hardware, so some heavy CPU usage will not cause data to be overwritten with the next byte.