Shop OBEX P1 Docs P2 Docs Learn Events
DS1302 Demo Code (Updated) - Page 4 — Parallax Forums

DS1302 Demo Code (Updated)

124»

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-01-14 13:56
    Yes, those variables are all byte values that are Binary Coded Decimal, which means each byte is really two individual 4-bit nibbles that contains that digit. Because of this you can't just increment seconds and always get the correct value. If your seconds variable contains a 9 and you increment it, the resulting value is not a valid BCD value for the DS1302.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-01-15 09:20
    As a note, you can also get individual register values without having to burst read all the values at once.
Sign In or Register to comment.