2017-11-10 05:09 AM - edited 2023-11-20 09:37 AM
Hello, I'm working with STM32F4 Discovery Board and trying to generate a 16-pulse signal with variable duty cycle like this on the picture below.
Currently i can generate 16 Pulse through One Pulse Mode. However i can't set the individual duty cycle using DMA burst feature. Does anyone know, how to solve this?
Thanks in advance.
2017-11-10 06:29 AM
And what are the symptoms? What is in the relevant TIM and DMA registers?
JW
2017-11-10 06:49 AM
Get the DMA to feed the timer compare register from an array which describe the sequence of duty cycles you need, and make it cyclical (so, no need to use any DMA interrupt). Then configure your timer for what you need.
If you make the timer period cover the whole burst, you can update the compare value several time until the timer overflow. If the timer overflow at 0xFFFF, you can set the timer to update the compare with 0x1000, 0x1010, 0x2020, 0x4000, etc....