2019-12-08 09:46 AM
I am implementing UART transmission in SPC560B50L1. Due to modest description in manual, I have some detailed questions:
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.
Solved! Go to Solution.
2020-02-03 05:09 AM
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:
DTF is set on the last bit of the last byte.
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
2019-12-17 06:54 AM
Any help, please?
2020-02-03 05:09 AM
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:
DTF is set on the last bit of the last byte.
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
2020-02-04 01:22 AM
Thanks!