I'm having trouble turning off the UART transmitter in an automatic DMA transfer to the THR register in the UART. The sequence of operations is:
1) Incoming characters hit the UART RBR Register triggering an EDMA transfer in the UART RX channel into "Buffer 1".
2) The TCCHEN bit in the OPT register of that PaRAM set is on to chain the TX event at the completion of the RX channel transfer.
3) When the RX EDMA transfer completes, the event is chained into the TX event bit in the EDMA.CER register.
4) The TX channel's EDMA transfer begins taking data from "Buffer 2" and sending it to the UART's THR register for transmission.
The problem is that I can't get it to stop after transmitting the buffer to wait for the next Chained Event from the RX channel. I want to send out "Buffer 2" and then wait for the next receipt of data for "Buffer 1" through the RX channel before sending "Buffer 2" a second time.
i) If I use a valid LINK in the PaRAM set to reload the TX PaRAM set when the transfer completes, then that linked PaRAM set gets loaded and the transfer starts up all over again and never stops.
ii) If I use a LINK of 0xFFFF in the TX PaRAM set it will stop the transfer at the right time but then when I try to reload the Tx PaRAM set with a Chained Event to another EDMA transfer, the completion of that third transfer starts up the transmission of data out of the UART all over again even though there has not been an event to trigger the transfer.
The confusing thing is that the RX channel EDMA PaRAM set seems to work flawlessly with the triggering events. The UART gets data, raises an event to the EDMA CC and the UART's RX PaRAM set reads the correct number of bytes from the UART's RBR register and then it STOPs after linking in a new PaRAM set. The Rx PaRAM set ends up sitting there ready to go the next time. One event and you have one transfer and a linked reload of the PaRAM set. But in the TX channel. one triggering event leads to an infinite number of DMA transfers if the PaRAM set has a linked PaRAM set.
I need to be able to have the UART's TX PaRAM set complete the A-synchronized transfer, link in the LINK PaRAM set and then sit there waiting for another triggering event.
I've tried to use other EDMA transfers to toggle the UART's PWREMU_MGMT.URTST bit to disable the transmitter but that doesn't work either and would be very kludgy even if it did.
Any help would be greatly appreciated.
Thanks,
Mike