Powering an STM32F103C8T6 With 12 Volts? - Page 1
Forum section: electronics / general

author: AlwaysAbia
author_rank: Contributor
timestamp: May 01, 2024, 01:56:52 pm
content: Microcontroller beginner here.I'm building a project where the main power supply is a 12 Volt Power Supply. The project contains an stm32 in it, so I was wondering if there was a way to power the MCU directly using 12Volts without having to use a step down converter.Thanks in advance.

author: tszaboo
author_rank: Super Contributor
timestamp: May 01, 2024, 02:05:43 pm
content: It's not possible.

author: tooki
author_rank: Super Contributor
timestamp: May 01, 2024, 02:08:02 pm
content: And don’t forget that any input signals to your MCU also need to be level shifted down to 3.3V.

author: wraper
author_rank: Unknown
timestamp: May 01, 2024, 02:18:59 pm
content: It does not necessarily need to be step down converter, it can be a linear voltage regulator IC (less efficient but OK for low current) but voltage must be brought down.

author: DavidAlfa
author_rank: Super Contributor
timestamp: May 01, 2024, 02:41:18 pm
content: Quote from: AlwaysAbia on May 01, 2024, 01:56:52 pmIf you're struggling with a such simple task, all I can say is good luck, everything else is going to be way more complex!Don't tell me more, it's Arduino and made of copy & paste in 95%...

author: hans
author_rank: Super Contributor
timestamp: May 01, 2024, 05:11:53 pm
content: No, for STM32F103, it's not possible.To draw some unusual inspiration, there are some "HV" PIC12/PIC16s out there:https://ww1.microchip.com/downloads/en/DeviceDoc/30010029B.pdfThese parts havea shunt regulator, e.g. an integrated Zener that regulate the voltage using an external shunt resistor. It requires substantial current to make it stable for a wide range of loads, for that PIC its between 1-50mA. (12-5) * 0.05=0.35W .Its easier (and more efficient) to use a linear regulator.. I wouldn't recommended such a powering scheme.

author: josip
author_rank: Regular Contributor
timestamp: May 01, 2024, 06:35:29 pm
content: Quote from: tooki on May 01, 2024, 02:08:02 pm(Most of) STM32F103 inputs are 5V tolerant.

author: radiolistener
author_rank: Super Contributor
timestamp: May 01, 2024, 10:11:03 pm
content: you can use linear regulator with 5V to power it. If regulator is not allowed, you can try to power it from two cells of 12V battery, one cell has working voltage range 1.95V and 2.12V for 0% and 100% charge. During charge it can raise up to 2.5V. So two cells give you about 4-5V which should be enough.But be careful, because it is possible high voltage spikes during using in vehicle. It can happens during starting or connect/disconnect some load. So, you're needs to use some voltage suppressor to protect STM32 and a small resistor to limit current through it. I recommend to install also low pass filter after voltage suppressor with electrolytic capacitor, it will also helps to smooth voltage spikes.

author: tooki
author_rank: Super Contributor
timestamp: May 02, 2024, 06:55:41 am
content: Quote from: josip on May 01, 2024, 06:35:29 pmYes, but not all are (and my teacher swore they sometimes failed at 5V, despite being specced as 5V-tolerant), so given OP’s skill level it’s probably better to have them be conservative.

author: tooki
author_rank: Super Contributor
timestamp: May 02, 2024, 06:57:32 am
content: Quote from: radiolistener on May 01, 2024, 10:11:03 pmAbsolutely not. This is a 3.3V part, with an absolute maximum supply voltage of 4.0V, so 5V will damage it. (I have the datasheet open, so don’t try to debate this.)

author: RoGeorge
author_rank: Super Contributor
timestamp: May 02, 2024, 07:09:28 am
content: If the microcontroller board doesn't draw too much current, a resistor and a Zener diode can be a good enough voltage regulator:Image from:https://en.wikipedia.org/wiki/Zener_diode

author: radiolistener
author_rank: Super Contributor
timestamp: May 02, 2024, 11:16:57 am
content: Quote from: tooki on May 02, 2024, 06:57:32 amThere is your mistake. If you read topic starter message more carefully, you would have noticed that he already said that he is microcontroller beginner. It will be very strange if he planning to solder bare STM32 chip on his own PCB, because this is definitely not beginner level. Most of all he is planning to use some dev board. That is classic use case for for amateur projects based on STM32.If you read it more deep, you can find that previously topic starter mentioned that he want to switch to STM32 dev board:Quote from: AlwaysAbia on March 04, 2024, 11:07:22 amSo, it is pretty clear that he is definitely NOT talking about bare STM32 chip. He is talking about STM32 dev board.As I understand, the topic starter is talking aboutBlue Pillboard which uses STM32F103C8T6. It already has 3.3V regulator on the board and is designed to be powered from 5V or 3.3V, it has both rails on its GPIO pin headers, so you can use any of them. I power it from external 5V with no issues. And it has USB connector with 5V line connected to 5V rail. It's already designed to work from 5V power supply.If you're not familiar with Blue Pill boards, you can check it on schematic:https://stm32-base.org/assets/pdf/boards/original-schematic-STM32F103C8T6-Blue_Pill.pdfAs you can see, it already hasRT9193-33which is 300mA, Ultra-Low Noise, Ultra-Fast CMOS LDO Regulator.So, believe me it will not be damaged if you power it with 5V through 5V pin on the headerAnd it has many 5V tolerant GPIO which can be used to communicate with 5V circuits, for example I'm connected LCD with 5V interface directly to STM32F103C8T6 GPIO (which is 5V tolerant) and it works with no issues.Here is picture which can be used to check which GPIO is 5V tolerant (see pins marked with green):

author: tooki
author_rank: Super Contributor
timestamp: May 02, 2024, 07:11:09 pm
content: Quote from: radiolistener on May 02, 2024, 11:16:57 amIt is not a mistake to answer the question as it was asked.This threadsays nothing about a dev board, it asks about the MCU, and the MCU unequivocally cannot be powered from 5V.Quote from: radiolistener on May 02, 2024, 11:16:57 am”Beginner” is a quite broad term, and while it’d certainly be unusual for a beginner to solder the bare chip, ifs not impossible — we’ve seen stranger things on the forum before! (For example, people who arehighlyexperiences with analog electronics or discrete logic, but just never got into MCUs before, for whatever reason.)Quote from: radiolistener on May 02, 2024, 11:16:57 amFair enough, I did not read OP’s other threads; that isn’t required.Yeah, I’m familiar with the Blue Pill, though I’ve never bothered with them myself. In that case, though, I’d recommend the OP choose something else, since it appears that essentially all Blue Pills now are made with clone/counterfeit MCUs that appear to introduce subtle incompatibilities.

author: radiolistener
author_rank: Super Contributor
timestamp: May 02, 2024, 08:05:50 pm
content: Quote from: tooki on May 02, 2024, 07:11:09 pmF103 is cheap but pretty old core. There is a sense to look for something more modern with hardware floating point, DSP features and other stuff, but on the other hand there are a lot of examples for F103, so it can be more easy for newbie.

author: tooki
author_rank: Super Contributor
timestamp: May 02, 2024, 08:10:57 pm
content: My point is that because modern Blue Pill boards seem to be made only with counterfeit chips, they don’t behave consistently. It doesn’t matter that the F103 is (or was) common: the Blue Pills you can buytodaydon’t contain a real F103. A beginner is unlikely to be able to identify and compensate for this if a problem were to appear, so it’s better to go for a board that uses an MCU that has yet to be counterfeited, for example ESP32 or Rpi Pico, or a genuine Nucleo from ST. Many of them have robust Arduino support.

author: radiolistener
author_rank: Super Contributor
timestamp: May 02, 2024, 08:28:18 pm
content: Quote from: tooki on May 02, 2024, 08:10:57 pmI bought a couple of Blue Pill boards on aliexpress about 5-6 years ago, they had 128 kB FLASH instead of 64 kB and working pretty good. It is enough for my needs. I cannot say something about modern fake chips, but I hear that modern Blue Pill boards from WeAct also works good.PS: If someone interested, I can prepare and share simple project forBlack Pill STM32G431CBU6for GCC compiler. It seems that there is not so much examples for this nice board, but it is very interesting because this is Cortex-M4 which can run at 170 MHz with 213 DMIPS and with 0-wait-state execution from flash. Also it has 128k FLASH, 32k RAM, hardware FPU, hardware CORDIC and FMAC accelerators and also has 12-bit DAC in addition to 12-bit ADC. Pretty nice board for DSP experiments.