How to Prevent 1.8V Signal from Reaching GPIO Input When MPU is Powered Down? - Page 1
Forum section: electronics / beginners

author: davegravy
author_rank: Regular Contributor
timestamp: October 27, 2024, 04:08:54 pm
content: I have a GPIO input on my MPU that may see a 1.8V logic high level while the MPU itself is powered down. This is causing unexpected behavior on the MPU, and I need a way to isolate or block the 1.8V from reaching the GPIO input unless the MPU is actively powered.The MPU outputs a 1.8V IO reference on VCC_IO, so I considered using an nMOSFET as a switch. My idea was to connect VCC_IO to the gate of the nMOSFET, with the drain connected to the GPIO input and the source to the 1.8V signal. However, I’ve noticed a non-zero voltage on VCC_IO when the MPU is off and the GPIO input has 1.8V, so it seems this might still turn on the MOSFET.Is there a recommended practice or circuit design approach to ensure the GPIO input only sees 1.8V when the MPU is powered up?

author: jpanhalt
author_rank: Super Contributor
timestamp: October 27, 2024, 05:00:25 pm
content: How about a pull-down resistor on that pin (4.7K to ?K)? If that doesn't work an analog SPDT switch might be used. I use the latter method to toggly a 1.5V supply

author: iMo
author_rank: Super Contributor
timestamp: October 27, 2024, 05:18:31 pm
content: Quote from: davegravy on October 27, 2024, 04:08:54 pmAn LTspice simulation..

author: davegravy
author_rank: Regular Contributor
timestamp: October 27, 2024, 05:27:43 pm
content: Quote from: jpanhalt on October 27, 2024, 05:00:25 pmQuote from: jpanhalt on October 27, 2024, 05:00:25 pmI should have mentioned it's designed to operate unattended so a manual switch isn't an option.Pull down I don't think would work because the source of the 1.8V signal that I'm trying to read into the MPU is the IO reference output (low impedance) of another device.

author: davegravy
author_rank: Regular Contributor
timestamp: October 27, 2024, 05:30:54 pm
content: Quote from: iMo on October 27, 2024, 05:18:31 pmI know what this is but I'm unclear what you're suggesting. Are you saying I should model the nMOSFET solution I mentioned in LTspice to see if my concern about it not working is valid? Or are you being cheeky and saying there would be no real 1.8V in that scenario because it's a simulationor?I'm not confident in my ability to model the internals of the MPU correctly.

author: langwadt
author_rank: Super Contributor
timestamp: October 27, 2024, 05:35:01 pm
content: Quote from: davegravy on October 27, 2024, 04:08:54 pmVCC_IO pull up on the GPIO and the mosfet the other way around (source to GPIO, drain to input signal)

author: jpanhalt
author_rank: Super Contributor
timestamp: October 27, 2024, 07:35:54 pm
content: @davegraveyThe analog switch would be held on by the MCU when it was awake and released when it was asleep. I am using a TS5A3157 to toggle a 1.5V source. It is not manual and the version I got is a small SMD package.

author: wraper
author_rank: Unknown
timestamp: October 27, 2024, 08:04:38 pm
content: If high signal speed is not needed, you could just add a series resistor (with built-in pull-up disabled when MCU is running) to limit the current to low enough level where it no longer causes any problem. Current will flow through MCU input protection to VDD, and if VDD impedance is low enough, it won't significantly lift the voltage.

author: davegravy
author_rank: Regular Contributor
timestamp: October 28, 2024, 11:17:23 am
content: Quote from: langwadt on October 27, 2024, 05:35:01 pmThanks. I should clarify: the input signal I’m monitoring is the output of a voltage regulator on an IC. The goal is to detect whether the regulator is in an ON or OFF state, but I believe it doesn’t get driven to 0V when turned off—it just floats. I should probably test that though.If it's floating and I use the MOSFET with a pull-up as recommended, wouldn’t this prevent detecting the OFF state?

author: davegravy
author_rank: Regular Contributor
timestamp: October 28, 2024, 11:20:26 am
content: Quote from: jpanhalt on October 27, 2024, 07:35:54 pmThanks, I knew about solid state relays but not these class of devices.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 28, 2024, 11:46:56 am
content: Quote from: wraper on October 27, 2024, 08:04:38 pmClarification to this: if VDD impedance at 0Hz (so DC resistance) is low enough. Also known as: having enough load on the supply rail. And even more specifically, "dumb" load which consumes even below certain minimum voltage threshold.Often these requirements are not satisfied, so even a tiny leakage current from IO pin through protection diodes slowly charges the capacitance on the supply rail, and after reaching some UVLO/BOD/whatever threshold, an IC (such as the microcontroller) decides to turn on; increasing power consumption and quickly consuming stored charge and dying again. The cycle repeats, making a slow oscillator.This might not be a problem, but something worth understanding might happen. Simplest solution, if this happens, is to add "stupid" load such as parallel resistor between VDD and GND. It will then form a voltage divider with the series resistor on the input. If input series resistor is large (say 10k), then some added 1k on the VDD bus is probably not too much extra consumption - unless the thing is battery powered.Or you can make sure the microcontroller does nothing dumb e.g. by adding a short delay in the boot where you do something power-consuming like turn a status LED on. It will brown-out and reset there instead of starting to do something.

author: davegravy
author_rank: Regular Contributor
timestamp: October 28, 2024, 12:32:41 pm
content: Quote from: Siwastaja on October 28, 2024, 11:46:56 amThis is battery powered so I don't think the parallel resistance is an option. I'll keep an eye out for this slow oscillation, I don't think a brief boot should harm anything, except maybe SD-card corruption if it gets as far as initializing it.I'm mainly worried about protecting the GPIO since I read warnings about protection diodes failing over time from pins having voltages on them when the MCU/MPU isn't powered. I think I already experienced this with my UART RTS/CTS.

author: wraper
author_rank: Unknown
timestamp: October 28, 2024, 12:39:11 pm
content: Quote from: davegravy on October 28, 2024, 12:32:41 pmThe danger isn't voltage but current that exceeds safe level.

author: PGPG
author_rank: Frequent Contributor
timestamp: October 28, 2024, 01:10:50 pm
content: Quote from: davegravy on October 27, 2024, 04:08:54 pmYou are trying to change this 1.8V signal into being OC but without reversing its logic. Is it important to not reverse it?If not than just go with this 1.8V through one transistor with OC output and pull-up to MPU supply.