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.
Comments