What is the procedure to setup Uart Transmission in One shot mode with a DMA?
Hi guys,
for some reason I can't this working for the life of me.
I am trying to implement a DMA with Uart Transmission with a one shot, reason being is that I noticed with the DMA on circular mode it just transfers whatever is in the buffer even theres nothing in it so its just sending 0's. I want it to control the timing of when to transmit data, like once the buffer as a real value in it.
Nothing been working for me. Things i have tried are
- Initially the DMA is disabled for Uart Transmit
- Write to the Buffer not TDR but the buffer thats affiliated with the DMA
- Enable DMA for Uart Transmission
- Wait for TC flag to set
- Clear the TC flag
- Disable DMA buffer
However this lead to receiving garbage values on the other end.
The problems I have occurred is that TC flag gets stuck on the second send, or the transmissions sends twice and not once.
Any ideas?