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:
- 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.
- 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