cancel
Showing results for 
Search instead for 
Did you mean: 

n-pulse with variable duty cycle

Tom Bombadil
Associate
Posted on November 10, 2017 at 14:09

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.


_legacyfs_online_stmicro_images_0690X0000060MvzQAE.png

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.


_legacyfs_online_stmicro_images_0690X0000060Mw4QAE.png
_legacyfs_online_stmicro_images_0690X0000060MxHQAU.png
_legacyfs_online_stmicro_images_0690X0000060MxMQAU.png

#n-pulse #dma #timer #stm32f4 #stm32
2 REPLIES 2
Posted on November 10, 2017 at 15:29

And what are the symptoms? What is in the relevant TIM and DMA registers?

JW

S.Ma
Principal
Posted on November 10, 2017 at 15:49

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....