AnsweredAssumed Answered

STM32F4 synchronise timer + generate variable frequency

Question asked by l..michael on Mar 7, 2016
Latest reply on Mar 14, 2016 by markt
Hi,

I have a litte problem. I need to generate a variable frequency (not duty cycle) for a piezo buzzer. Unfortunately the PCB layout is givn as a H-bridge (see image). "Piezo" is connected to TIM4_CH1 and "Piezo2" is connected to TIM3_CH1. Since the PCB does not use the pins of a advanced timer I can not use the built in TIMx_CHx_N feature / dead time generation.

So I thought I could try to synchronise the two timers TIM3 and TIM4 and generate a variable frequency with 50% duty cycle. But I could not find any code showing the generation of a variable frequency (variable prescaler, reload value ???) synchronising two inverted timers. Can anyone help me with a piece of code, a link or other sources than the reference manual?

Thank you in advancebuzzer.PNG

Outcomes