Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

75%
+4 −0
Q&A Level shifting of a 3 state logic pin

I want to design a simple battery charger using MCP73831/2. This chip has a 3-State state pin according to the table below: I have a 3.3V MCU and I want to connect this pin to a GPIO. The MCU is...

2 answers  ·  posted 2y ago by dekker‭  ·  last activity 11mo ago by Nick Alexeev‭

#2: Post edited by user avatar Lorenzo Donati‭ · 2023-08-10T12:15:46Z (over 1 year ago)
Retagged.
#1: Initial revision by user avatar dekker‭ · 2022-04-09T11:13:14Z (over 2 years ago)
Level shifting of a 3 state logic pin
I want to design a simple battery charger using [MCP73831/2][1]. This chip has a 3-State state pin according to the table below:

[![enter image description here][2]][2]

I have a 3.3V MCU and I want to connect this pin to a GPIO. The MCU is not 5V tolerant and maximum votlage on any pin is given 3.6V per datasheet (esp32).

My question is, how can I safely connect this STAT pin to my MCU? How can I translate its HIGH state (which is I guess 5V) to 3.3 and its LOW state to 0V (logic low). Is a resistor divider enough for this? or will I need to use mosfet or transistors? Here is my circuit:


[![enter image description here][3]][3]
[![enter image description here][4]][4]


  [1]: http://ww1.microchip.com/downloads/en/DeviceDoc/20001984g.pdf
  [2]: https://i.stack.imgur.com/GiEHb.png
  [3]: https://i.stack.imgur.com/cGPAz.png
  [4]: https://i.stack.imgur.com/GdNjr.png