cancel
Showing results for 
Search instead for 
Did you mean: 

Problem trying to generate pwm by configurating the pin pb10 as open drain.

EMedi.1
Associate

Hi, i`m having an issue driving a mosfet(irfz44n n channel---it`s a boost converter from 12v to 42v dc), the thing is that i`m usnig a PWM signal of the stm32f103c8tx, when it`s a %50 duty cycle i`ve got around 1.6v aprox, it`s not enough to power the gate properly, so i added a totem pole config with an extra npn transistor driving them, but the problem persists, i`ve been reading and find out about the open drain mode, so the pin pb10 is in GPIO_MODE_AF_OD but when i generate the pwm the 3.3v shows up, does anybody have an idea on how to doi it? .. I`m using cubemx.

The circuit is working cause i can reach 60vdc at the output, but i need to change the duty cycle to control the 42vdc.

Since i can`t figure it out, i`ve been thinking on a smaller mosfet to level the tension to 5v, with the 2n7000 or bs170. 11

Sorry for al the text, thanks!!

2 REPLIES 2
TDK
Guru

If you initialize it as a GPIO OD output, can you drive the circuit? If so, the problem is in how you're using the timer.

Might be easier to explain with a schematic.

If you feel a post has answered your question, please click "Accept as Solution".
EMedi.1
Associate

Hi, yes, actually the problem was that, what i did now is that i set the pin as GPIO_MODE_AF_OD and then i set the timer2 channel 3 as pwm generation no output, with a pull up resistor to 5v, and the square wave is correct, inverted but ok, just change the way that generates it, so it`s working good right now.