SPRUIZ1B July 2023 – August 2024 TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
When using the DMA with the TX FIFO, the DMA Burst Size [DMA_BURST_SIZE] must equal 16 - the number of bytes used to trigger the FIFO level interrupt defined by TXIFSEL in UARTIFLS. For example, a level of 1/8 is triggered by having 14 bytes or less present in the FIFO, so DMA_BURST_SIZE = 16 - 14 = 2. To make sure that the DMA writes all data correctly to the TX FIFO, the DMA Burst Size must also be an integer divisor of the total number of UART transmissions. For complete data transmission, follow these steps:
1. Decide the total number or words to be transmitted. [BUFFER_SIZE]
2. Decide the necessary FIFO level [UART_BUFFER_SIZE] and set TXIFSEL accordingly.
3. Calculate the number of DMA transfers. [DMA_TRANSFER_SIZE = BUFFER_SIZE / UART_BUFFER_SIZE]
4. Calculate the DMA Burst Size [DMA_BURST_SIZE] to equal 16 - UART_BUFFER_SIZE.
5. Configure the DMA using the calculated values and use UART peripheral trigger as the trigger source.
To transmit 120 words from the UART using the DMA:
BUFFER_SIZE = 120
UART_BUFFER_SIZE = 12
TXIFSEL: 1 - (UART_BUFFER_SIZE / 16) = 1 - 3/4 = 1/4
DMA_TRANSFER_SIZE: (BUFFER_SIZE / UART_BUFFER-SIZE) = (120/12) = 10
DMA_BURST_SIZE: UART_BUFFER_SIZE = 12
(1 burst = 12 words, 1 transfer = 10 bursts, 120 words transmitted with each transfer)