# 1-bit EEPROM with 2N7000 MOSFET

#### popcalent

Joined Mar 17, 2018
47
Hello everybody,

I'm trying to design a 1-bit EEPROM with the ultimate goal of designing a 4x4 bit EEPROM. I need it for a bigger project, and I feel I would be wasting the full potential of a commercial EEPROM if I were to use one. For instance, it doesn't make any sense to use a 28C16 if I'm only using 16 bits. I'm using the 2N7000 MOSFET. These are my designs:

For the debugging purposes, my output is just an LED for now. The switch in design (1) can be connected to positive, to negative, or to nothing. When I switch to nothing, the output keeps the last state (positive or negative). But when I turn off the power, the output is not kept.

Design (2) has a push button that works as a Write Enable, and a switch that connects to positive or negative (unlike the switch in (1)). I added a 2N2222 transistor to drive the Write Enable, and a 1uF capacitor. This keeps the output status even after I turn it off, but only for a period of time. I haven't check, but I'd say it's just a few minutes.

How do I design a memory cell that works as a real EEPROM? That is, it keeps the output status after power down forever. I'm a newbie, so I assume my designs are full of mistakes.

Thank you all!

#### ElectricSpidey

Joined Dec 2, 2017
1,671
You are not going to get there in that direction...perhaps some latching relays?

#### popcalent

Joined Mar 17, 2018
47
You are not going to get there in that direction...perhaps some latching relays?
Thanks for your reply. I think that using 16 latching relays would be too bulky, and too expensive. I was trying to emulate the way real EEPROMS works internally. Apparently, I'm not very good at it!

#### dl324

Joined Mar 30, 2015
12,871
I was trying to emulate the way real EEPROMS works internally.
EEPROMs are much like the EPROMs that preceded them. They store charge on a floating gate and are nonvolatile. To do that with regular MOSFETs, you need to use a battery or super capacitor; like Dallas Semiconductor does for some of their NVRAMs, which are battery backed SRAMs. The simplest would probably be anti-parallel CMOS inverters.

EDIT: Before the corrections start, I'll clarify and say that the storage element is similar. EEPROM used a different program/erase method so they didn't require an external programming voltage.

If you can find them, Xicor X2110 would be good. They're 64x4 SRAMs with each bit backed up by an EEPROM. You use them like an SRAM and store before you power down. The CMOS version will automatically restore EEPROM contents to SRAM on power up. They're in an 18 pin DIP.

I have a number of X2210 and find them useful for small nonvolatile memories.

EDIT: eBay has listings for X2210, but I'd be suspicious of them (being counterfeit) and they're asking $5-20. If you're in the US, I'd sell you some. Last edited: Thread Starter #### popcalent Joined Mar 17, 2018 47 EEPROMs are much like the EPROMs that preceded them. They store charge on a floating gate and are nonvolatile. To do that with regular MOSFETs, you need to use a battery or super capacitor; like Dallas Semiconductor does for some of their NVRAMs, which are battery backed SRAMs. The simplest would probably be anti-parallel CMOS inverters. If you can find them, Xicor X2110 would be good. They're 64x4 SRAMs with each bit backed up by an EEPROM. You use them like an SRAM and store before you power down. The CMOS version will automatically restore EEPROM contents to SRAM on power up. They're in an 18 pin DIP. I have a number of X2210 and find them useful for small nonvolatile memories. EDIT: eBay has listings for X2210, but I'd be suspicious of them (being counterfeit) and they're asking$5-20. If you're in the US, I'd sell you some.
The X2210 look interesting. Unfortunately, I moved from the US a year ago, so I'll have to find them somewhere else. How much should I pay for them?

Another solution is to use a backup coin cell (I need to learn how to do that) and use a 74170 (4x4 RAM). I mean, if I have to use a backup battery anyway, I might as well use the IC that does exactly what I want but is a RAM and not an EEPROM. This is what game cartridges did in the 80s/90s.

#### dl324

Joined Mar 30, 2015
12,871

#### DickCappels

Joined Aug 21, 2008
7,442
The only programmable memory I ever used that stayed programmed "forever" was an ancient (by today's standards) PROM that was programmed by blowing nichrome fuses (I warned you that it was ancient). All of the others, given enough time forgot some their programming.

#### popcalent

Joined Mar 17, 2018
47
Another solution is to use a backup coin cell (I need to learn how to do that) and use a 74170 (4x4 RAM). I mean, if I have to use a backup battery anyway, I might as well use the IC that does exactly what I want but is a RAM and not an EEPROM. This is what game cartridges did in the 80s/90s.
On that note, can I just connect the Vcc and GND of the 74170 to the coin cell, and the rest of the pins to the main circuit?

Edit: I just saw your reply about TTL not retaining memory down to 3V

#### dl324

Joined Mar 30, 2015
12,871
On that note, can I just connect the Vcc and GND of the 74170 to the coin cell, and the rest of the pins to the main circuit?
No. TTL requires 4.75V-5.25V or 4.5V-5.5V; depending on supply tolerance.

If you could use a 3V battery, you'd need to prevent it from being charged while the circuit was powered and for the battery to only provide backup to the memory.

#### Papabravo

Joined Feb 24, 2006
16,165
This kind of thinking is actually a counterproductive waste of time. If you need some small quantity of non-volatile storage, you get the cheapest chip you can find, use what you need and ignore the rest. You just can't do everything they do on chips with discrete parts.

#### crutschow

Joined Mar 14, 2008
27,232
Another solution is to use a backup coin cell (I need to learn how to do that)
Use Schottky diodes to isolate the battery.

You could use the CMOS CD4099 8-bit addressable latch, which draws only leakage current in the static state.
A 3V lithium coin cell should maintain its state essentially for the shelf life of the battery.

Last edited:

#### popcalent

Joined Mar 17, 2018
47
Use Schottky diodes to isolate the battery.

You could use the CMOS CD4099 8-bit addressable latch, which draws only leakage current in the static state.
A 3V lithium coin cell should maintain its state essentially for the shelf life of the battery.
Thanks for your reply. Do I need the Schottky diode if the coin cell is only powering the CD4099 and the main power supply is powering the rest of the circuit? Ie. The main power supply won't power the CD4099.

My understanding is that I need the Schottky to isolate the battery if the battery was powering the whole circuit, and, therefore, conflicting with the main power supply. Perhaps I'm wrong.

#### BobTPH

Joined Jun 5, 2013
3,319
For minimum size and cost, I doubt you could beat a 6-pin PIC.

Bob

#### crutschow

Joined Mar 14, 2008
27,232
Do I need the Schottky diode if the coin cell is only powering the CD4099 and the main power supply is powering the rest of the circuit? Ie. The main power supply won't power the CD4099.
That's okay as long as you account for the difference in voltage between the coin cell and the power to the rest of the circuit.
The input signal voltages can be no higher than the battery voltage unless the input current is limited.
A 10kΩ resistor in series with each input will work for that.

Also the output signal voltage of 3V may be marginal if the rest of the circuit is operated from 5V.
One solution is to use two batteries, for an operating voltage of about 6V for the CD4099.

And the CD4099 can not have an output load when the power is off, otherwise it will drain the battery.

What is the supply voltage to the rest of the circuit?
Can it be varied?

Last edited:

#### popcalent

Joined Mar 17, 2018
47
And the CD4099 can not have an output load when the power is off, otherwise it will drain the battery.
How do I do that?
What is the supply voltage to the rest of the circuit?
Can it be varied?
It's 5V, I think I'll do two coin cells for 6V and use a diode to make it 5.3V.

#### popcalent

Joined Mar 17, 2018
47
And the CD4099 can not have an output load when the power is off, otherwise it will drain the battery.
How do I do that? Can I use transistors with their bases connected to the main supply to disconnect each output from GND when the power is off?
What is the supply voltage to the rest of the circuit?
Can it be varied?
It's 5V, I think I'll do two coin cells for 6V and use a diode to make it 5.3V.

#### atferrari

Joined Jan 6, 2004
4,330
Your switches would require debouncing.

#### dl324

Joined Mar 30, 2015
12,871
53 cents, 6-pin SOT23 (same size as many SMT transistors, 128 bytes of Flash data memory.
And if you can’t think of 3 other components it could replace in your design, you haven’t much imagination.
How much glue logic do you think it would take to convert addresses and data from parallel to serial and back? Seriously...

Last edited: