phillavery
New Member
Hi
Can anyone suggest an easy method of creating an inteval timer using the DS1307. I have problems with the BCD maths when adding a timing interval to the last alarm time. e.g. using only minutes, alarm timer 58 minutes add 17 min = 75 (dec) - 60 to get minutes = 15 min. In practice this starts as $58 in bcd - 60 = 0F which is not a valid number for the Ds1307. The problem is that the DS1307 does not use the "hex" numbers - 0a, 0b etc but moves from $09 to $10 in one increment. As such a simple subtraction does not seem to be the answer. Any assistance would be appreciated, I have developed a complicated way of skipping the "hex" numbers but feel that there is probably a much more elegant (and simple) way of doing it.
Thanks Phil
Can anyone suggest an easy method of creating an inteval timer using the DS1307. I have problems with the BCD maths when adding a timing interval to the last alarm time. e.g. using only minutes, alarm timer 58 minutes add 17 min = 75 (dec) - 60 to get minutes = 15 min. In practice this starts as $58 in bcd - 60 = 0F which is not a valid number for the Ds1307. The problem is that the DS1307 does not use the "hex" numbers - 0a, 0b etc but moves from $09 to $10 in one increment. As such a simple subtraction does not seem to be the answer. Any assistance would be appreciated, I have developed a complicated way of skipping the "hex" numbers but feel that there is probably a much more elegant (and simple) way of doing it.
Thanks Phil