The RTC works in BCD Format.
If you want to set the date to the 25th. you would have to write $25 not a decimal 25 (which is $19)
If you write a decimal 25 for the 25th of a month you are in trouble:
at midnight the RTC will increment the decimal 25 ($19) to $20 (NOT $1A, because we are talking BCD!),
which results in decimal 32, which is an invalid date in your decimal coding!
If you want decimal numbers for easier editing/calculation you have got to convert them.
See the examples you have got.
Last edited by NavMicroSystems; - 26th April 2005 at 00:27.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Bookmarks