using CMOS

I am building a circuit which needs to retain the state of an 8 bit variable after being powered off. I heard CMOS works for this, but haven't found any resources explaining how this works. Can anyone point me to a resource which goes into detail on these.

Also, are there any other ways to maintain the state of an 8 bit variable after a circuit is powered down?

Also, are there any other ways to maintain the state of an 8 bit variable after a circuit is powered down?

EEPROM

I think perhaps the idea is to use "CMOS" battery-backup RAM in an RTC, but is there an RTC?

The EEPROM library is the thing to use on Arduinos (except for the Due which has none).

How long does it need to remember? You can put a capacitor on a CMOS gate and it will stay charged for a very long time because the DC resistance is extremely high.

Hi, what is the application, there may be many ways to do it, but one better than others.

Tom..... :)

CMOS has very low current draw when it is not being switched. You can't power down, but you can stop the clock - that's how '328P goes into low power mode, most clock functions are turned off.

If you want to completely remove power, than battery backup is needed, or EEPROM, or FRAM, for storage.

CMOS is a technologie used to build gates ... ( but if you want to build something HC families is nice for Arduino)

If you want to save something like few bytes , most microcontrollers have eeprom space one them . You can also add a module, something like ebay RTC (realtime clock) on the clock ds1307 their is 56 bytes of ram with batterie backup... same modules also have a eeprom of few Kbytes. It could be safer for you to try and external module first :-)

voidptr: You can also add a module, something like eBay RTC (realtime clock) on the clock ds1307 their is 56 bytes of ram with battery backup...

So if you happen to have - or need - a real time clock in your project, you have battery-backed RAM with virtually unlimited write endurance (you do not have to be concerned about writing to it too frequently as you do with EEPROM - you can do so thousands of times every second so that what is recorded is always up to date).

Using a RTC is the cheapest way of implementing battery-backed RAM (in small amount) using ready-built modules with I2C interface. .

I'm not so sure about that: http://www.digikey.com/product-search/en?FV=fff40027%2Cfff80434%2C401993%2C26802e4%2Cf040003&k=eeprom&mnonly=0&newproducts=0&ColumnSort=1000011&page=1&stock=1&pbfree=0&rohs=0&quantity=&ptm=0&fid=0&pageSize=25 Can get and 8-pin DIP, 1Kbyte to 8Kbyte EEPROM for around 50 cents, add a 0.1uF cap and you're good to go. Simple RTC, like DS1307, is more, add the battery, holder, crystal, turns out to be a lot more. The RTCs with built in crystal are more money too.

CrossRoads:
Can get and 8-pin DIP, 1Kbyte to 8Kbyte EEPROM for around 50 cents, add a 0.1uF cap and you’re good to go.

I’ve used some of the Microchip serial EEPROMS and they are cheap and convenient. You do have to watch out for the number of writes they can handle though (10^5 to 10^6), and not write too frequently. Writing data once per second will exceed a 1 million write/erase cycle limit after about about 11 days of continuous use.

If you need to retain the state in an external IC with parallel I/O, I came across an 8-bit non-volatile latch. The FM573/FM574 where these can be updated over 10 billion state changes. Unfortunately, I don't think they're available anywhere. Too bad, I could use a few of these "1 byte FRAMs". Looks like 64,000 bytes is as small as you can get these days.

CrossRoads: Can get and 8-pin DIP, 1Kbyte to 8Kbyte EEPROM for around 50 cents, add a 0.1uF cap and you're good to go. Simple RTC, like DS1307, is more, add the battery, holder, crystal, turns out to be a lot more.

Of course :D - but I did specify "battery-backed RAM" and explained the reason why.

There's always FRAM then - 10^10 write cycles. 1,000,000,000/60/60/24/356 = a write/second for 31 years. Assuming the same address is written to over and over and over. http://www.mouser.com/Semiconductors/Memory/F-RAM/_/N-488wv?Keyword=fram&FS=True&Ns=Pricing|0 Only 1 DIP part at Mouser, none at Digikey. Looks like SMT is taking over everywhere. SPI apparently less money than I2C also.

"CMOS" as a "retains data when the power is off" technology, PROBABLY is a reference to the battery-backed-up CMOS RAM in most desktop PCs that holds the bios parameters and stuff (usually there's a clock/calendar (RTC) in the same chip.) You probably wouldn't want to use that on an Arduino, where the most common method of saving data across power cycles is to use the EEPROM memory that is included on the AVR chip itself.

The EEPROM on the mega328 chip used on most Arduino holds up to 1kBytes, and is described here: http://arduino.cc/en/Reference/EEPROM