Skip to main content
Killstreet30
Associate III
February 14, 2023
Solved

Doubt on how to interface a 5V circuit to a 3V microcontroller (STM32) - Input Pins

  • February 14, 2023
  • 1 reply
  • 4393 views

0693W00000YAfLGQA1.png 

Hello,

The input 1 and input2 signals will be fed from an STM32 but the problem is the signal sent from STM32 is 3.3V but the input to the IC is 5V. How do I convert the same? Please help.

This topic has been closed for replies.
Best answer by KnarfB

Well, that good olde L293D.

This is a no brainer because even 3.3V supplied GPIO output generates 5V TTL compatible signal levels.

See data sheet of your chip.

Application note AN4899 "STM32 microcontroller GPIO hardware settings..." is worth reading.

1 reply

KnarfB
KnarfBBest answer
Super User
February 14, 2023

Well, that good olde L293D.

This is a no brainer because even 3.3V supplied GPIO output generates 5V TTL compatible signal levels.

See data sheet of your chip.

Application note AN4899 "STM32 microcontroller GPIO hardware settings..." is worth reading.

Killstreet30
Associate III
February 14, 2023

0693W00000YAi6JQAT.png 

I thought I'll use this circuit but how will I calculate the R and R' values? Any idea?

LCE
Principal II
February 15, 2023

That way you build a voltage divider so that the input will never see neither 0 V nor 5 V.

So better check the datasheet what "5V input" means (high / low thresholds, min / max over complete temperature range), then you might find that what KnarfB said is correct.

The most simple level shifter would be putting a npn transistor (or N-mosfet) "between" your 2 resistors, although then you would have an inverted signal.