question on using timer and DMA for complex signal generatio
Posted: Mon Jan 20, 2014 4:02 pm
I have a couple of questions about using a timer and DMA for signal generation on the STM32F4-discovery.
I want to use a timer to generate 3 "interrupts" to trigger three different DMA transfers.
I am planning on using the "reload" interrupt and 2 capture compare interrupts to trigger the DMA transfers.
A. The first interrupt will trigger on timer reload to DMA a fixed value to a 16-bit port.
B. The second interrupt will trigger a DMA transfer of the next half-word of a buffer to the same 16-bit port.
C. The third interrupt will trigger a DMA transfer of a different fixed value to the same 16-bit port.
Basically, I want to transfer 1000 16-bit values from a buffer at 800kHz with a fixed value before and after the value from the buffer. This cycle will repeat at about 800kHz until the buffer is transferred.
A couple of "quick" questions....
1. Do any of the Chibios timer functions let me use the three DMA triggers? It looks
like I will need to directly control the timer config. Just wanted to know if I was missing something.
2. Is there a way to set up a DMA transfer of a 1000 half-word buffer and trigger each transfer individually, or will the trigger start the dma transfer and run till the complete buffer is transferred?
Thanks!
-John Scott
I want to use a timer to generate 3 "interrupts" to trigger three different DMA transfers.
I am planning on using the "reload" interrupt and 2 capture compare interrupts to trigger the DMA transfers.
A. The first interrupt will trigger on timer reload to DMA a fixed value to a 16-bit port.
B. The second interrupt will trigger a DMA transfer of the next half-word of a buffer to the same 16-bit port.
C. The third interrupt will trigger a DMA transfer of a different fixed value to the same 16-bit port.
Basically, I want to transfer 1000 16-bit values from a buffer at 800kHz with a fixed value before and after the value from the buffer. This cycle will repeat at about 800kHz until the buffer is transferred.
A couple of "quick" questions....
1. Do any of the Chibios timer functions let me use the three DMA triggers? It looks
like I will need to directly control the timer config. Just wanted to know if I was missing something.
2. Is there a way to set up a DMA transfer of a 1000 half-word buffer and trigger each transfer individually, or will the trigger start the dma transfer and run till the complete buffer is transferred?
Thanks!
-John Scott