This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTC ds12887 is not displaying time correctly.

I am successfully able set the time in ds12887 but while reading time it shows wrong time.
only second value is coming and overriding hour and minute value. So i cant solve this problem.
please take a look in following code.

     void DisplayTime()
     {
        XBYTE[11]=0x20;
        hr = XBYTE[14];
        writeLcdcmd(0x87);
        BCD_Conv(hr);
        WriteLcdData(':');
        min = XBYTE[12];
        writeLcdcmd(0x8A);
        BCD_Conv(min);
        WriteLcdData(':');
        sec = XBYTE[00];
        writeLcdcmd(0x8D)
        BCD_Conv(sec);
     }

but this display only second value and unfortunately hr and min value is also overriding

Parents
  • Try replacing your XDATA[] reads with constants, prove the output routines function properly.

    If those work properly, then the values in the XDATA[] array isn't what it's supposed to be and the problem is with how the RTC state is being read into the array (not shown).

    Learn how to debug.

Reply
  • Try replacing your XDATA[] reads with constants, prove the output routines function properly.

    If those work properly, then the values in the XDATA[] array isn't what it's supposed to be and the problem is with how the RTC state is being read into the array (not shown).

    Learn how to debug.

Children