Logic power up state...

Discussion in 'General Electronics Chat' started by liquidair, Jan 10, 2013.

  1. liquidair

    Thread Starter Active Member

    Oct 1, 2009
    89
    5
    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!
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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?
     
    liquidair likes this.
  3. liquidair

    Thread Starter Active Member

    Oct 1, 2009
    89
    5
    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?
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,033
    3,241
    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.
     
  5. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    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.
     
  6. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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: Jan 10, 2013
  7. liquidair

    Thread Starter Active Member

    Oct 1, 2009
    89
    5
    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.
     
  8. SPQR

    Member

    Nov 4, 2011
    379
    48
    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.
     
  9. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    ...sounds like a form of non-volatile memory;)

    This would work rather simply...
     
  10. liquidair

    Thread Starter Active Member

    Oct 1, 2009
    89
    5
    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.
     
  11. SPQR

    Member

    Nov 4, 2011
    379
    48
    23 switches?!?!:)
    You need a microcontoller with lots of in/out pins!!!:D
     
Loading...