1 year, 5 months ago.

STMF103 PWM

Hi Guys

I don't have a STM103 to play with but am working on a schematic that includes one. I need to drive a magnetic buzzer with PWM signal. Can someone just check for me: PB8 according the datasheet is TIM4_CH3 so I assume it's capable of delivering a 2700hz signal.

/media/uploads/riaancillie/f103_datasheet.png

But the mbed board page's pretty picture doesn't show that it supports PWM. See attached pictures.

/media/uploads/riaancillie/f103_mbed.png

Which one do I trust?

1 Answer

1 year, 5 months ago.

Riann -

You cannot use PB8 for pwm using mbed, but both documents are technically correct.

Check the file "PeripheralPins.c" for this board and you see that mbed uses TIM4 for the ticker function. You cannot use any of the TIM4 channels for pwm without changing the default timer.

JR

Accepted Answer