In order to disable TX DMA if it is not needed anymore (e.g. all transfers are done and UART idle mode is desired), the following sequence must be use
- DMA mode 1 is set (both TX/RX DMA) by registers UARTi.UART_SCR[0] = 0 and UARTi.UART_FCR[3] = 1:
- Set the UARTi.UART_SCR[2:1] DMA_MODE_2 bit fields to 01 (DMA mode 1)
- Set the UARTi.UART_SCR[0] DMA_MODE_CTL bit to1 (this setting of UARTi.UART_SCR[0] DMA_MODE-CTL will ignores UARTi.UART_FCR[3] DMA_MODE_CTL bit )
Note: It is strongly suggested to do steps ‘a’ and ‘b’ in two separate write in order to avoid malfunction of the device.
- Set the UARTi.UART_FCR[3] DMA_MODE bit to 0. It is not necessary but suggested to avoid restore of DMA mode 1 during accidental reset of UARTi.UART_SCR[0] DMA_MODE_CTL bit. Be sure that all data was read out from RX FIFO and if it possible disable the RX side. In UART mode the RTS/CTS or XOFF/XON protocol can be used. In IrDA modes RX can be forcibly disabled by setting UARTi.UART_ACREG[5] DIS_IR_RX bit
Note: There can be RX DATA loss during the next steps if all DATA was not read out or there was an ongoing reception!
- Set the UARTi.UART_FCR[2:1] DMA_MODE bit field to 11 (clear TX and RX FIFO and resets its counter logic to 0. Returns to 0 after clearing FIFO).
- Set the UARTi.UART_SCR[2:1] DMA_MODE_2 bit field to 10 (DMA mode 2, RX only).
- Set the UARTi.UART_FCR[2:1] DMA_MODE bit field to 11 (clear TX and RX FIFO and the DMA request again).
- Set the UARTi.UART_SCR[2:1] DMA_MODE_2 bit field to 00 (no DMA) or keep 10 if RX DMA is needed.
- DMA mode 1 is set (both TX/RX DMA) by registers UARTi.UART_FCR[3] = 0 and UARTi.UART_SCR[0] = 1, UARTi.UART_SCR[2:1] = 01. It is almost the same as above, but steps ‘a’, and ‘b’ can be skipped:
- Set the UARTi.UART_FCR[3] DMA_MODE bit to 0. It is not necessary but suggested to avoid restore of DMA mode 1 during accidental reset of UARTi.UART_SCR[0] DMA_MODE_CTL bit. Be sure that all data was read out from RX FIFO and if it possible disable the RX side. In UART mode the RTS/CTS or XOFF/XON protocol can be used. In IrDA modes RX can be forcibly disabled by setting UARTi.UART_ACREG[5] DIS_IR_RX bit
Note: There can be RX DATA loss during the next steps if all DATA was not read out or there was an ongoing reception!
- Set the UARTi.UART_FCR[2:1] DMA_MODE bit field to 11 (clear TX and RX FIFO and resets its counter logic to 0. Returns to 0 after clearing FIFO).
- Set the UARTi.UART_SCR[2:1] DMA_MODE_2 bit field to 10 (DMA mode 2, RX only).
- Set the UARTi.UART_FCR[2:1] DMA_MODE bit field to 11 (clear TX and RX FIFO and the DMA request again).
- Set the UARTi.UART_SCR[2:1] DMA_MODE_2 bit field to 00 (no DMA) or keep 10 if RX DMA is needed.
- DMA mode 3 is set (TX DMA only) by registers UARTi.UART_FCR[3] = 0 and UARTi.UART_SCR[0] = 1, UARTi.UART_SCR[2:1] = 11. It is the same as above:
- Set the UARTi.UART_FCR[3] DMA_MODE bit to 0. It is not necessary but suggested to avoid restore of DMA mode 1 during accidental reset of UARTi.UART_SCR[0] DMA_MODE_CTL bit. Be sure that all data was read out from RX FIFO and if it possible disable the RX side. In UART mode the RTS/CTS or XOFF/XON protocol can be used. In IrDA modes RX can be forcibly disabled by setting UARTi.UART_ACREG[5] DIS_IR_RX bit
Note: There can be RX DATA loss during the next steps if all DATA was not read out or there was an ongoing reception!
- Set the UARTi.UART_FCR[2:1] DMA_MODE bit field to 11 (clear TX and RX FIFO and resets its counter logic to 0. Returns to 0 after clearing FIFO).
- Set the UARTi.UART_SCR[2:1] DMA_MODE_2 bit field to 10 (DMA mode 2, RX only).
- Set the UARTi.UART_FCR[2:1] DMA_MODE bit field to 11 (clear TX and RX FIFO and the DMA request again).
- Set the UARTi.UART_SCR[2:1] DMA_MODE_2 bit field to 00 (no DMA) or keep 10 if RX DMA is needed.