How come the value in my RAM of DS1307 RTC become zero?

Discussion in 'Embedded Systems and Microcontrollers' started by ahgan84, Oct 12, 2014.

  1. ahgan84

    Thread Starter Member

    Dec 19, 2011
    55
    0
    Hi guys... I'm using the 56 bytes of RAM in the DS1307 to store some data. My DS1307 is connected to the PIC18F46K22. But after running a few days, all the data inside the RAM will suddenly become zeros. The time in the RTC is still accurate but it's just that all the data in the RAM has become zero. I have check my coding but cannot pin point what's the problem. Do you guys have any idea? I did not reset it to zero from my coding...
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,437
    3,360
    Show your code. Show your circuit.

    What kind of power source or battery do you have connected to pin-3, VBAT? What is the voltage?
     
  3. ahgan84

    Thread Starter Member

    Dec 19, 2011
    55
    0
    It is a 3V CR2032 battery.
     
  4. ahgan84

    Thread Starter Member

    Dec 19, 2011
    55
    0
    Is there any possibilities that during the time when data is written to the RAM, there is some interruption from the ISR? I am using a timer in the ISR.
    Do we need to put INTCONbits.GIE = 0; when data is written to the RTC RAM?
     
Loading...