cancel
Showing results for 
Search instead for 
Did you mean: 

Detailed behaviour of LinFlex registers during transmission (UART mode)?

Yannek
Associate III

I am implementing UART transmission in SPC560B50L1. Due to modest description in manual, I have some detailed questions:

  1. I set UARTCR[TDFL]=3, set TXEN and fill BDRLs registers, starting transmission.

What is the exact moment when the DTF flag will be set? On which edge of which byte transmitted by UART?

2. Can I access (read or write) BDRL registers before DTF flag is set? How does modification of BDRL registers affect transmission?

3. Is it possible to interrupt pending transmission? Like in the middle of byte being transmitted.

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Giuseppe DI-GIORE
ST Employee

​Hello,

as reported by Reference Manual:

In order to start transmission in UART mode, you must program the UART bit and the transmitter enable (TXEN) bit in the UARTCR to 1. Transmission starts when DATA0 (least significant data byte) is programmed. The number of bytes transmitted is equal to the value configured by UARTCR[TDFL]

The Transmit buffer is 4 bytes, hence a 4-byte maximum transmission can be triggered. Once the programmed number of bytes has been transmitted, the UARTSR[DTF] bit is set. If UARTCR[TXEN] is reset during a transmission then the current transmission is completed and no further transmission can be invoked.

Specific to your questions:

  1. I set UARTCR[TDFL]=3, set TXEN and fill BDRLs registers, starting transmission.
  • What is the exact moment when the DTF flag will be set? On which edge of which byte transmitted by UART?

DTF is set on the last bit of the last byte.

  1. Can I access (read or write) BDRL registers before DTF flag is set? How does modification of BDRL registers affect transmission?

After starting the transmission BDLR registers are accessible, However transmission is unpredictable.

3. Is it possible to interrupt pending transmission? Like in the middle of byte being transmitted.

Transmission can be interrupted at any time by settgin UARTCR[TXEN] = 0

Regards,

Giuseppe

View solution in original post

3 REPLIES 3
Yannek
Associate III

Any help, please?

Giuseppe DI-GIORE
ST Employee

​Hello,

as reported by Reference Manual:

In order to start transmission in UART mode, you must program the UART bit and the transmitter enable (TXEN) bit in the UARTCR to 1. Transmission starts when DATA0 (least significant data byte) is programmed. The number of bytes transmitted is equal to the value configured by UARTCR[TDFL]

The Transmit buffer is 4 bytes, hence a 4-byte maximum transmission can be triggered. Once the programmed number of bytes has been transmitted, the UARTSR[DTF] bit is set. If UARTCR[TXEN] is reset during a transmission then the current transmission is completed and no further transmission can be invoked.

Specific to your questions:

  1. I set UARTCR[TDFL]=3, set TXEN and fill BDRLs registers, starting transmission.
  • What is the exact moment when the DTF flag will be set? On which edge of which byte transmitted by UART?

DTF is set on the last bit of the last byte.

  1. Can I access (read or write) BDRL registers before DTF flag is set? How does modification of BDRL registers affect transmission?

After starting the transmission BDLR registers are accessible, However transmission is unpredictable.

3. Is it possible to interrupt pending transmission? Like in the middle of byte being transmitted.

Transmission can be interrupted at any time by settgin UARTCR[TXEN] = 0

Regards,

Giuseppe

Yannek
Associate III

Thanks!