Author Topic: Powering an STM32F103C8T6 With 12 Volts?  (Read 1071 times)

0 Members and 1 Guest are viewing this topic.

Offline AlwaysAbiaTopic starter

  • Newbie
  • Posts: 3
  • Country: ge
Powering an STM32F103C8T6 With 12 Volts?
« on: May 01, 2024, 01:56:52 pm »
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.
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7424
  • Country: nl
  • Current job: ATEX product design
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #1 on: May 01, 2024, 02:05:43 pm »
It's not possible.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11643
  • Country: ch
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #2 on: May 01, 2024, 02:08:02 pm »
And don’t forget that any input signals to your MCU also need to be level shifted down to 3.3V.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16904
  • Country: lv
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #3 on: May 01, 2024, 02:18:59 pm »
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.
« Last Edit: May 01, 2024, 06:39:52 pm by wraper »
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5964
  • Country: es
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #4 on: May 01, 2024, 02:41:18 pm »
The project contains an stm32 in it, so I was wondering if there was a way to power the MCU directly using 12Volts
Thanks in advance.
If 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%...  ::)
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: Dazed_N_Confused

Online hans

  • Super Contributor
  • ***
  • Posts: 1645
  • Country: nl
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #5 on: May 01, 2024, 05:11:53 pm »
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.pdf

These 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.
 

Offline josip

  • Regular Contributor
  • *
  • Posts: 154
  • Country: hr
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #6 on: May 01, 2024, 06:35:29 pm »
And don’t forget that any input signals to your MCU also need to be level shifted down to 3.3V.

(Most of) STM32F103 inputs are 5V tolerant.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3436
  • Country: ua
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #7 on: May 01, 2024, 10:11:03 pm »
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.
« Last Edit: May 01, 2024, 10:15:17 pm by radiolistener »
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11643
  • Country: ch
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #8 on: May 02, 2024, 06:55:41 am »
And don’t forget that any input signals to your MCU also need to be level shifted down to 3.3V.

(Most of) STM32F103 inputs are 5V tolerant.
Yes, 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. ;)
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11643
  • Country: ch
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #9 on: May 02, 2024, 06:57:32 am »
you can use linear regulator with 5V to power it.
Absolutely 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.)
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6280
  • Country: ro
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #10 on: May 02, 2024, 07:09:28 am »
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

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3436
  • Country: ua
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #11 on: May 02, 2024, 11:16:57 am »
Absolutely 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.)

There 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:
I have tried using an Arduino...
I was thinking of switching to an STM32 board since it offers a much higher clock speed.

So, 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 about Blue Pill board 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.pdf

As you can see, it already has RT9193-33 which 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 header  :)
And 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):
« Last Edit: May 02, 2024, 12:11:12 pm by radiolistener »
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11643
  • Country: ch
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #12 on: May 02, 2024, 07:11:09 pm »
Absolutely 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.)

There is your mistake.

It is not a mistake to answer the question as it was asked. This thread says nothing about a dev board, it asks about the MCU, and the MCU unequivocally cannot be powered from 5V.

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.
”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 are highly experiences with analog electronics or discrete logic, but just never got into MCUs before, for whatever reason.)


If you read it more deep, you can find that previously topic starter mentioned that he want to switch to STM32 dev board:
I have tried using an Arduino...
I was thinking of switching to an STM32 board since it offers a much higher clock speed.

So, 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 about Blue Pill board 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.pdf

As you can see, it already has RT9193-33 which 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 header  :)
And 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):

Fair 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. :(
 
The following users thanked this post: wraper

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3436
  • Country: ua
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #13 on: May 02, 2024, 08:05:50 pm »
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. :(

F103 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.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11643
  • Country: ch
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #14 on: May 02, 2024, 08:10:57 pm »
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 buy today don’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.
« Last Edit: May 02, 2024, 08:13:51 pm by tooki »
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3436
  • Country: ua
Re: Powering an STM32F103C8T6 With 12 Volts?
« Reply #15 on: May 02, 2024, 08:28:18 pm »
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 buy today don’t contain a real F103. A beginner is unlikely to be able to identify and compensate for this, 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.

I 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 for Black Pill STM32G431CBU6 for 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.  :)
« Last Edit: May 02, 2024, 08:35:10 pm by radiolistener »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf