2025-09-24 4:13 AM - last edited on 2025-09-24 5:57 AM by Andrew Neil
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.
Solved! Go to Solution.
2025-09-30 9:38 AM
@boulganamed wrote:
When I take a properly functioning charger equipped with the ST62 IC and measure the voltages on its pins, I obtain values such as: Pin 8 (VSS) = 14V, and Pin 12 (VSS) = 2.03V.
You may need to analyze in deep what you are measuring here. 14V measured on a chip pin having a power supply of 5V doesn't have any sense. I'm pretty sure there is something wrong in the method of your measurement or on the source you are probing. ..
What device are you using to measure the voltage: oscilloscope, multimeter?
@boulganamed wrote:
Pin 8 (VSS) = 14V, and Pin 12 (VSS) = 2.03V..
Of which device? of ST6 itself? of the board that contains that MCU?
2025-09-30 10:21 PM
> When I take a properly functioning charger equipped with the ST62 IC and measure the voltages on its pins, I obtain values such as: Pin 8 (VSS) = 14V, and Pin 12 (VSS) = 2.03V.
And measured against what ?
To determine voltages at the STM32 pins, you need to measure against the STM32 GND potential.
For the ST62xx, against the respective GND pins as well.
If the values you are quoting were correct, the ICs would be fried within milliseconds.
2025-10-01 2:53 AM
@Andrew Neil @Ozone @mƎALLEm @TDK
i think my measurement good because i put positive in the pin and negative in vss pin (st62 connected with charger).
and also the charger work good with original application
2025-10-01 3:08 AM
You still haven't said what you're using to make the measurement.
But clearly it is way outside the chip's Absolute Maximum ratings - so there has to be something wrong!
This is why it's so important that you have the schematic of the circuit you're working with.
The facts remain:
2025-10-01 3:10 AM
@Andrew Neil i used multimeter
2025-10-01 3:51 AM
@boulganamed wrote:This documentation provides complete technical details for implementation, testing, and troubleshooting of the Industrial 24V battery charger controller system.
Well, it gives you a specification for if you were developing a new charger from scratch.
But you're not doing that.
You are trying to modify an existing design.
For that, you need details of the existing design - schematics, etc.
@boulganamed wrote:I am not trying to hack or reverse engineer a commercial charger system.
It very much seems that you are!
@boulganamed wrote:My goal is to undertake this project myself as a way to upgrade my skills in both hardware and software programming.
This project is clearly some way beyond your current hardware skills & knowledge.
You need to set this aside, and spend some time gaining experience with electronics.
2025-10-01 6:20 AM
@boulganamed wrote:
@Andrew Neil @Ozone @mƎALLEm @TDK
i think my measurement good because i put positive in the pin and negative in vss pin (st62 connected with charger).
Sorry I don't think so. I'm pretty sure there is something wrong either in your description or in the way you are measuring the voltage level. I think you are not measuring directly on the MCU pins but on the board pins... 14V is a level of the battery voltage during the charge process not the voltage generated by the MCU.. Sorry.
2025-10-01 6:33 AM
> I think you are not measuring directly on the MCU pins but on the board pins... 14V is a level of the battery voltage during the charge process not the voltage generated by the MCU.. Sorry.
... unless the MCU section is thoroughly fried, in a high-impedance zombie state, and the measured voltage is back-fed from the battery charger.
2025-10-01 6:53 AM
The original question, "STM32F030F4P6 - PWM output voltage", has been answered long ago.
Further discussion seems pointless, as the OP can't/won't provide necessary info - schematics etc.
@mƎALLEm I think it's time to close this thread?