Hi, I did this recently. I used an ICL7673 from Harris (if memory is
correct) to switch the Vcc for the SRAM between the PIC supply and the
backup battery. It selects the greater of two input voltages and
directs it to SRAM Vcc.
The CS\ of the SRAM has to be tied up to it's Vcc. That way when the
power is off it is still unselected by battery power. Unfortunately, if
a PIC pin is controlling the SRAM cs\ directly, then when the PIC's
power is off, battery power is drained through the PIC's internal
protection diodes. I used a mosfet (can't remember how exactly) so
that battery current wouldn't leak through cs\ pull-up and through PIC
pin.
This should isolate the SRAM from the PIC. I used Hitachi
something-something-256 but it had "SLP" or "ULP" markings (for
super/ultra low power). I used 2032 lithium coin cell and the only time
it drained was when I accidentally short circuited it.
I didn't bother with data getting corrupted because it powered itself
down so can't suggest anything from experience here. :)
Gary Patterson wrote:
{Quote hidden}>
> Hi,
>
> I've got an application where I want to use a large capacity, low power
> SRAM along with a PIC controller. The SRAM will be used to hold data
> and I want to use battery backup to protect the contents of the SRAM,
> should someone accidentally disconnect the power supply from the circuit
> etc.
>
> Can somebody help me with 2 questions?
>
> 1. What circuitry is necessary to implement battery backup for an SRAM?
> 2. If the PIC is writing to SRAM when the power goes off, how do I
> ensure that invalid data isn't advertently written to the SRAM?
>
> I am using PIC I/O lines to directly control the address/data/control
> lines of the SRAM.
>
> Thanks for your help!
>
> Regards,
> Gary Patterson
>
> e-mail:
.....nukepepKILLspam
@spam@hotmail.com
>
> ______________________________________________________
> Get Your Private, Free Email at
http://www.hotmail.com