UART idle state for TC277

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

cross mob
Not applicable
Hi, Which flag should I be looking at to generate an interrupt when the asynchronous UART has completed receiving a message and the line is now idle for some number of bit periods?
How do I configure that number of bit periods?
I am getting confused by the different meanings for different protocols.

Thank you,
Charlie
0 Likes
7 Replies
Not applicable
the manual gives this description:
• Interrupt generation
– On a configurable transmit FIFO level
– On a configurable receive FIFO level
– On an error condition (frame, parity, overrun error)
– On various module internal events (end of ASC/SPI frame, LIN events)

which is what I want to take advantage of. I have enabled the flags one at a time but can't seem to get a message complete interrupt. Yes, I can get a RX interrupt for every byte, but not one at
the end of the message.

maybe I am asking the wrong question? How do you detect the end of an asynchronous frame?

thank you,
Charlie
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Hi Charlie. UARTs are generally byte-oriented - there's no predefined frame protocol.

A typical implementation might use one DMA channel to handle a transmit buffer, and use another DMA channel to receive into a circular buffer. A slower periodic task might read that circular buffer and parse out the bytes.

LIN does have a defined protocol, which is why the AUTOSAR MCAL has an available LIN driver.
0 Likes
Not applicable
thank you. I am coming over from the Atmel AVR32 and the Motorola 68360 before that. They both had counters in the UART that counted idle bit periods and could trigger an
interrupt after reaching that amount of idle time. We used these a lot because we would then know that the message was complete without knowing how long the message was.

Do you think that the manual refers to a "frame" as a single byte wrapped in start, stop, and parity bits? where as I was thinking it was a collection of bytes in a long message.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
For UART, a frame is absolutely one start/data/parity/stop bit sequence.
0 Likes
Not applicable
Is there any chance the 2nd generation Aurix supports this feature? I am awaiting the NDA and eventually want to use the TC375.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
The ASCLIN peripheral hasn't changed in the TC3xx.

What protocol are you trying to decode? There are lots of tricks you can do with DMA - check out conditional linked lists, where you can stop on a "pattern" (e.g., a particular termination byte value).
0 Likes
Not applicable
good tip, maybe i can do something clever. I will look more closely at the streams. Thanks.
0 Likes