cancel
Showing results for 
Search instead for 
Did you mean: 

Is there possible to get PWM (0-5V) instead of (0-3.3V) in stm32f4?

musthafafarhan
Associate II
Posted on January 19, 2016 at 08:07

I am trying to generate the PWM from STM32F4 micrcontroller. The PWM output was done but it is 0-3.3V range. May I possible to configure the PWM voltage range (0-5V) if so, can someone guide me the way to proceed it.

Thank you. 

5 REPLIES 5
pkumar1883
Associate II
Posted on January 19, 2016 at 09:14

Dear farhan.musthafa,

For 0-5V output you will have to use a level shifter(using transistor).On base give input(0-3.3v).

AvaTar
Lead
Posted on January 19, 2016 at 09:44

BTW, most Cortex M devices from Cypress / former Spansion / former Fujitsu work with 5.0V directly, i.e. have a VDD of up to 5V.

Software support for hobbyists is another topic ...

Posted on January 19, 2016 at 19:06

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/set%20voltage%20for%20GPIO%20PINS&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=44]Earlier Duplicate Thread

Can we please stop asking the same question over and over, stick to one thread

Are there current driving requirements too? Perhaps you can use some buffering chip to provide suitable voltage and current for your application?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
musthafafarhan
Associate II
Posted on January 20, 2016 at 08:12

Yes I get your point. I am still in the research to find out the way to get 5V. It is because I beleive STM32F407xx has some pins for 5V tolerance. Need to confirm wether it is possible, otherweise I ill try with external circuit.

Posted on January 20, 2016 at 13:51

Yes, most of the pins are 5V Tolerant, but they are not capable of generating 5V or other arbitrary voltages. You can change the VDD used by the processor/IO, but not to the levels you are requesting.

Also the pins have limited current sink/source capabilities, check the pin/device maximums. These will be insufficient to drive/brake motors.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..