Logic power up state...

Thread Starter

liquidair

Joined Oct 1, 2009
192
Hi all-

I recently dove into electronic switching to replace the standard mechanical toggle switching. I used CMOS logic circuitry and this was my first journey into the logic realm. The problem I am having is that I want the switches to start up in the same state they were in on power down...Is this impossible without getting into micro's?

Thank you in advance!
 

tshuck

Joined Oct 18, 2012
3,534
Not unless you implement a non-volatile memory to dump the 'switch' settings before power down and reload them on power up.

What do you mean by switch? Flip-flop? transistor?
 

Thread Starter

liquidair

Joined Oct 1, 2009
192
Thank you, tshuck!

I'm using flip-flops and counters (CD4013, CD4017, and CD40175) to control BJT and MOSFET relay drivers.

I assume that implementing non-volatile memory means some sort of computer control, which means micro's? At that point, I might as well dump the 4000 chips and just go 100% micro, correct?
 

crutschow

Joined Mar 14, 2008
34,433
You don't need a micro but you do need memory for that. Since CMOS circuits draw very small static currents (microamp or less), you can use a battery (isolated by diodes) to keep it powered when the power is down, which will retain the state of the CMOS circuitry. The battery will typically last about as long as its shelf life at such low currents.

Edit: For this to work you will need to also isolate any significant current-drain loads on the CMOS outputs. MOSFET gates are OK, but BJT's will draw current so you will have to add a MOSFET driver for those or some other technique to isolate those loads.
 

kubeek

Joined Sep 20, 2005
5,795
You could use a battery to hold the states, like cr2032. These chips consume just tens of μA, so the battery life could be pretty good. But you will have to carefuly design the supply and interconnects so that you supply only the critical parts, and not pullups and other power hogs.
 

tshuck

Joined Oct 18, 2012
3,534
Yes, there is no guarantee what state your flip flops will come up in(a counter is basically a bunch of flip flops), so you'd have to make a preload circuit.

there are tons of types of non-volatile memory(look at the right hand bar)
Non-volatile memory doesn't mean computer control, it just means that the memory will retain its state without power. You could implement this in your design, but a microcontroller would probably be the easiest route since you'd need to add a lot more logic to your design in its current form.

If you were to use a microcontroller, you'd probably end up storing these values in a EEPROM type of memory. However, When a microcontroller resets/turns on, the I/O will come up in tri-state mode, then you can load your output values from memory, so you'd have a very brief point of no output. It's a very easy route, once you overcome the learning curve.

Edit: Yes a battery could provide power and maintain states, what I've said thus far is true with no power
 
Last edited:

Thread Starter

liquidair

Joined Oct 1, 2009
192
Thank you all for the responses! I was going to teach myself Micro's anyway so it looks like that's where I'll be headed next...seems like the most reasonable solution especially when adding a battery would require more house keeping circuitry anyhow. I think the Micro would actually simplify my circuitry a bit.
 

SPQR

Joined Nov 4, 2011
379
Hmmm...I was wondering if a latching relay might work for you.
How many switches, and how many times a day do you change them?

I'd much prefer a digital solution, but an interesting intellectual exercise would be to do it non-digitally.
 

tshuck

Joined Oct 18, 2012
3,534
Hmmm...I was wondering if a latching relay might work for you.
How many switches, and how many times a day do you change them?

I'd much prefer a digital solution, but an interesting intellectual exercise would be to do it non-digitally.
...sounds like a form of non-volatile memory;)

This would work rather simply...
 

Thread Starter

liquidair

Joined Oct 1, 2009
192
SPQR, Good thinking! I am afraid however there's 23 switches total, some of which have multiple on settings, not just on/off. This would quickly get out of hand. I still thought about it and it could likely be done.
 

SPQR

Joined Nov 4, 2011
379
SPQR, Good thinking! I am afraid however there's 23 switches total, some of which have multiple on settings, not just on/off. This would quickly get out of hand. I still thought about it and it could likely be done.
23 switches?!?!:)
You need a microcontoller with lots of in/out pins!!!:D
 
Top