cancel
Showing results for 
Search instead for 
Did you mean: 

How to PWM with repetition with STM32 timers

hashtala
Associate II

Hello

I am basically designing an interrupter for plasma arc speaker.

I have a small signal amplifier which I connect to STM32F746 and perform FFT to determine which note was played. Whole process takes about 2ms.

My transformer works with 25khz. I want to turn it off and on again on the note frequency I want to play. For that I need to implement PWM repetition mode.

signal will look like this0693W000005Cy92QAC.pngHowever I am not sure how to do that without software and making unnecessary delay to turn the timer off and on again.

What is the best option to save processing time and achieve this kind of signaling ?

1 ACCEPTED SOLUTION

Accepted Solutions

Use two timers as master-slave. Master generates the "slow" waveform, and the same OC is used as TRGO; slave is set to the higher frequency and it's slave-mode controller set to be controlled from master timer, in Gated mode.

JW

View solution in original post

2 REPLIES 2

Use two timers as master-slave. Master generates the "slow" waveform, and the same OC is used as TRGO; slave is set to the higher frequency and it's slave-mode controller set to be controlled from master timer, in Gated mode.

JW

Thanks Jan. That clarified everything.

if somebody find this question additionally I would like to add that you have to got and look datasheet up to see interconnecting triggers.

0693W000005CyxqQAC.pngit should look like this. Then you know which timer can be slave and which can be configured as master.

then you just need to set cubemx accordingly