Battery backup for on board RTCC on Pic 18F27J13?

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I would like to add battery backup for the RTCC on a P18F27J13. What I am trying to figure is a way for the battery power not to run the pic when normal power is applied.

One though I had was to have a mosfet switch that would be normally held off during normal operation. Yhe pic would use the HLVD interrupt to turn the battery on when the power drops.

Would there be enough time to sitch on the osfet or would the rtcc already lode its time in the period it takes to turn on the battery.

Is there a better way to do this?

I saw one post that suggests using VDCore (which I have) to power the pic from the battery but not sure I understood how even after reading the data sheet.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830

No I didn't. But there seems to be an awful lot going on in that thread and I am not sure what the anser is or even if there is one.


I do see where they are using RA0 to detect power failure but I don't think I need to do that since I have HLVD that works during sleep. So I am pretty sure I can both put the Pic to sleep and wake it up using HLVD. I am sort of stuck with using it as I am out of pins. Unless I want to use the PGD and PGC pins which I hate doing because of debugging. Or move to a serial LCD but I would have to sit down and write the code for that.

What I am not seeing is how the battery is not running the pic when normal voltage is applied.
 

nsaspook

Joined Aug 27, 2009
13,315
They're using diode OR isolation with a higher supply voltage on the mains supply of 3.7 vs 3.0 on the CR3032 to reverse bias the backup supply diode (a low leakage device is better).
 
Last edited:
Top