Strange behavior on the UART001 App.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User2235
Level 3
Level 3
Hi.
I'm testing the UART001 app using the XMC4500 Relax Lite kit.

Configuration:
baud: 115200
Stop Bit 1
Data Bits 8
Transmit Fifo size 16
Receive Fifo size 2
Trigger limits 1
UART Receive Pin: P1.4
UART Transmite Pin P1.5

Standard Receive Interrupt

I also configured the NVIC002 App:

// Serial Interrupt Handler

void SerialReceive_Handler(void)
{
RxBuf[RxNumBytes++] = UART001_ReadData(&UART001_Handler);

}

Issue:
when I transmit the character "A" to the Relax Kit, the interruption is generated and RxBuf = "A", as expected.

Then I transmit tha character "B" also as expected, the interrupt is generated and RxBuf = "AB".

But, when I transmite the character "C" there's no interrupt.

After that I transmite the character "D" and the interrupt is generated again, but the RxBuf = "ABC".

If I transmit the character "A" again, the interrupt is generated and the RxBuf = "ABCD".

Others characters like E, F, I, J, L, O, Q, etc. also don't generate ISR but are read by the interanal Data Buffer of the USIC.

What should be the problem?
0 Likes
1 Reply
oreste
Employee
Employee
Welcome! 50 replies posted 25 replies posted
Hi Amsantos,
I would like to highlight the following:
setting the triggering to 1 means that you get a trigger when there is one entry in the FIFO and you are receiving one more. see the tooltip of trigger limit.
I expect that you get the first trigger after receiving two bytes and by reading only one character you leave one byte in the buffer.
I can't explain the other behavior of your program without having more details about the time between the bytes.
But if the filling level exceeds the limit and for some reason the interrupt is not served you will not get any longer a interrupt.
This happens because the interrupt is triggered only when the filling level cross the limit only in ascending direction.

However I recommend to use ReadMultipleData to ensure that there is no extra data in the FIFO.

Best Regards
Oreste
0 Likes