cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate PWM pulse with varying timer period?

phenom
Associate II

Hi,

I am working on STM32F56G eval board. I need to generate a PWM pulse with varying time period on a single channel. I am new to stm32 PWM. With DMA burst code example time period is changing on the runtime .

How can I generate a PWM pulse with different time period on a single channel?

Eg : 1 pulse (x time period) + 2 pulse (y time period) +3 pulse (x time period)

If it is possible to generate such PWM pulse pattern then please suggest approach or example code.

Any help is appreciated.

2 REPLIES 2
S.Ma
Principal

Chose a timer with DMA channel on the channel, and define a marco period of 6 pulse period.

Use the DMA cyclic table to go through the 12 toggle events.

Is this what you need implemented?

Thanks.

I want to implement a pattern of pulse with varying time periods.

A output on oscilloscope should be like :

A pulse (1Khz) + delay (200ms) + pulse (2KHz) +..

Where I need to add delays between pulses.

Any steps to achieve such a pattern is helpful.