cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030F4P6 - PWM output voltage

boulganamed
Visitor

I am working on a project to replace a legacy ST62 IC in a industrial charger 24V/45A charger with an STM32 microcontroller (STM32F0 series). The main issue is with the PWM signal generation using TIM1 and TIM3. Both timers have 16-bit prescalers (value 0 to 65535), and I need to generate a PWM at 1 kHz with about 1000 steps of resolution.

My timer clock is 8 MHz. Based on calculations, prescaler and ARR values can generate correct frequencies, but the PWM output voltage is only around 2.7V instead of the expected 5V, and there is no effective voltage output for charging.

I suspect this issue is linked to the STM32CubeMX pinout or timer configuration:

  • Correct PA6 pin configuration for TIM3 PWM output.

  • Proper timer frequency setup: prescaler around 725 with ARR 0 tested, but PWM not as expected.

  • Possible problem in software initialization or timer start sequence affecting PWM output.

  • Relay control pins and PWM outputs may not be correctly activated or sequenced.

I have tested a new STM32 board without programming, same issue persists, suggesting it’s not hardware damage but configuration.

Would appreciate help reviewing timer config, pin assignments, and software steps to properly initialize and start PWM on TIM1/TIM3 for reliable voltage output.

4 REPLIES 4
TDK
Super User

> the PWM output voltage is only around 2.7V instead of the expected 5V

Output voltage when the pin is high should be VDD, which is typically 3.3 V. It will never be 5 V. You can use a transistor if you need a 5 V output.

If you feel a post has answered your question, please click "Accept as Solution".
Andrew Neil
Super User

@boulganamed wrote:

I am working on a project to replace a legacy ST62 IC in a industrial charger 24V/45A charger with an STM32 microcontroller (STM32F0 series). .


So was the legacy ST62 a 5V device?

As @TDK said, the STM32F0 are 3V - so you're going to have  to pay attention to that in all your interfaces...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

thanks for your reply:

but i used a card of stm32f030f4p6 like this :

boulganamed_0-1758722867345.jpeg

 

thanks for your reply:

but i used a card of stm32f030f4p6 like this :

boulganamed_0-1758722867345.jpeg