Need a latching buffer, need help configuring - Page 1
Forum section: electronics / beginners

author: jnz
author_rank: Frequent Contributor
timestamp: December 29, 2018, 12:03:26 am
content: 5V micro. Another device that has an enable line internally pulled up. I need to selectively latch and hold this line low while my micro is off.I currently have a trace going from my micro to a device and ground when needed, but I can't force the pin to be held low while the micro resets otherwise not running for some time. I can't just permanently hold the line low. Can't use a pull down, as it's internally pulled up, I'm trying to keep quiescent current low.My thought was to find way to make a latching output I trigger from my micro. I don't really see a great way to do this considering I need HIGH, LOW, and while reset or unpowered my micro's pin will be an input.Opamp? Transistor pair? Some buffer IC?

author: David Hess
author_rank: Super Contributor
timestamp: December 29, 2018, 12:25:56 am
content: It sounds like an application for a set/reset latch which many flip-flops like the ubiquitous 74HC74 can operate as. It has active low asynchronous set and reset inputs, the clock like can be used as an additional rising edge input to set either output state, and it includes complementary outputs. Or you can use a pair of NAND or NOR gates configured as a set/reset latch.

author: mvs
author_rank: Frequent Contributor
timestamp: December 29, 2018, 01:09:15 pm
content: Quote from: jnz on December 29, 2018, 12:03:26 amIf inversion and switching speed are not a concern i would go for small MOSFET (2N7002 or BSS138) and weak pullup.

author: Zero999
author_rank: Super Contributor
timestamp: December 29, 2018, 02:52:34 pm
content: Sorry I don't understand what you're looking for.Do you want to hold the pin low for a short length of time after the MCU has been turned on? If so, a simple capacitor to 0V will do that.

author: fsr
author_rank: Regular Contributor
timestamp: December 29, 2018, 03:40:22 pm
content: It seems to me like you need a circuit that pulls the line low, unless the micro pulls it up. The response from mvs looks like a good, cheap way to do that.

author: jnz
author_rank: Frequent Contributor
timestamp: December 31, 2018, 07:13:19 pm
content: Yes. I had considered just a mosfet to keep the line low by default, then only the micro being there could raise it up by shutting the mosfet down. That works fine, although I was hoping for an elegant latching solution it really doesn't matter at all and this gets me done quickly.Please see attached sim mockup.I'm not sure but I think it might be good practice to have a resistor between the switch (micro output) and the mosfet gate. But I'm not sure what value or what it does exactly because the gate can't see much more than 5V from the micro.The 2N7002 or BSS138 would be fine, but I need something in a smaller package. Looking at SOT-323 or SOT-416 because its going to be TIGHT on space. Something like this or thishttps://www.mouser.com/datasheet/2/348/ru1j002yn-e-1018335.pdfhttps://www.mouser.com/datasheet/2/348/re1c002untcl-e-1018231.pdfComments about diagram or parts?EDIT: Also an issue here is that when I want the device 'disabled' I'm throwing away 55uA via the 100k pulldown, 55uA for this application is fine, but say I wanted to do better.... I kinda wonder if 200k would work here because of how rarely it's going to switch and how long I can wait to ensure it's transitioned?

author: fsr
author_rank: Regular Contributor
timestamp: January 01, 2019, 05:22:39 pm
content: Yes, a resistor there to limit the current looks like a good idea.As the pullup is 100k, it seems like switching speed is not an issue, so you could begin with a 10k resistor, and see how it works. If that's enough, then fine, if not use a lower value.

author: jnz
author_rank: Frequent Contributor
timestamp: January 01, 2019, 08:42:46 pm
content: Quote from: fsr on January 01, 2019, 05:22:39 pmSo the switching speed isn't a factor. But the leakage from the 100k when the micro is grounding the gate is. At 100k that's 50uA... I'll just have to figure out if a 200k would work for a weak pullup. Separate question I'll make a post on.

author: fsr
author_rank: Regular Contributor
timestamp: January 01, 2019, 10:23:31 pm
content: uhm... you are pulling down the internal pullup resistor, which says to be 1k. That's 5 mA, which totally dwarf the 50 uA current. Are you sure it's 1k?

author: jnz
author_rank: Frequent Contributor
timestamp: January 01, 2019, 10:48:56 pm
content: Quote from: fsr on January 01, 2019, 10:23:31 pmI just tossed something in on that 1k, I have no idea what it actually is.But, more importantly, it's backwards. That 1k keeps it asleep. It's low power mode is for that not to be grounded. So normally, you do nothing to that line and it's in low power state. But, if I have a mosfet to "reverse" the logic so it's normally in run mode, then I'm pulling that 100k down just to get the device back to sleep.Make sense?EDIT: To clarify, pulling down on that device is the case I don't care about for low power. Leaving it alone is, so it doesn't matter even if it was 1k (which it probably isn't). But just to "leave it alone" I need to pull a 100K which is 50uA or so.

author: fsr
author_rank: Regular Contributor
timestamp: January 02, 2019, 08:56:15 pm
content: Well, if that's the case, then raise the resistor value, but keep connections short and low impedance, because at some point, noise could be an issue. Also it will turn slower with higher resistance values, so check to see if that becomes an issue.

author: jnz
author_rank: Frequent Contributor
timestamp: January 02, 2019, 10:25:47 pm
content: Tested it just now... Turns out it's 4V and approx 250k. So not 'just' an internal pullup, but effectively.