Skip to main content
hashtala
Associate III
Nov 27, 2020 9:37 PM UTC
Solved

How to PWM with repetition with STM32 timers

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 ?

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Nov 27, 2020 10:12 PM UTC

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

2 replies

waclawek.jan
waclawek.janBest answer
Super User
Nov 27, 2020 10:12 PM UTC

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

hashtala
hashtalaAuthor
Associate III
Nov 28, 2020 11:00 AM UTC

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