> Barry Coram wrote: > > Hello and thanks for reading this message, > I am building a project using a 16c877 with a couple of 8-bit latches > etc to interface to a 32kx8bit memory chip. I have managed to get this > working OK, but I want to battery back this when the power is turned > off. > > Being naive I thought that just using a couple of diodes to the RAM > power supply pin would be enough to do the job...No chance it draws > 15-18mA from the backup supply when the main supply is off, this > despite the whole circuit drawing only 10 - 12mA in normal operation! > > I have since found out that these static RAM chips have to be set into > a 'data retention mode'. Now can somebody please point me in the > direction of a suitable circuit (simple if possible) which will > reliably set the RAM chip into this mode on power down? > > PS the RAM chip I have is Goldstar type GM76C256L-10 (100nS?) which I > presume is a generic type. The problem seems to be that the RAM consumes that much when it is selected and output is active. If both pins /CE and /OC are up level, it should consume very little current. What happens when you power off the PIC? it drains down /CE and /OC pins, right? so it selects the chip and it consumes. There is a problem also with the RAM /W (write) pin that also goes down with the PIC powered off. All those 3 pins should still in up level when it goes for power backup. Now you need to think a circuit that does it. Perhaps using a CMOS inverting gates between PIC and the RAM, and keep this cmos gates with power too, so when PIC powers off those gates will keep up level at those RAM pins. You can also try to switch PIC Ground instead +VCC, by this way all PIC pins will be toward +VCC instead Ground, so keeping those 3 Ram's pins virtually up during PIC power off. A high value resistor in parallel to the diode that connects Ram's VCC to PIC's Vcc will ensure a minimum pullup current through the PIC to Ram's 3 pins. 100k? .------RRRRR------. | | +5VCC-----o------>|---------o------|<--------. | diode | diode + PIC | 3V | RAM Backup o | Battery / o switch | | | | | Gnd--------o----------------o----------------' You will have few problems when returning power to PIC, since it can drive LOW level to those 3 Ram's pins. The worst problem is the /W pin, it can write trash into the RAM, but it can be in a specific address, the one formed by the address pins at the power up, if it is constant, just avoid to use that address... Other point is the RAM's +VCC, it really doesn't need full voltage during the retention mode, lots of them can do it with less than Vcc/2, what also reduces current. Poor's man solution. $$$'s man solution = Take a look at DALLAS http://www.dalsemi.com they have plenty of smart sockets to convert any SRAM chip into a NonVolatile... with battery and something more.