Some additional direction.
12hr Mode
Display Value to LCD:
- Mask off 12/24Hr mode bit
- Mask off am/pm bit
- Display new masked value with Hex2 modifier
Change Hour Value in RTC:
- Mask off 12/24Hr mode bit
- Mask off am/pm bit
- Convert new masked value from BCD to Decimal
- Change Hour value in Decimal
- Convert Decimal Hour back to BCD
- Set am/pm bit
- Set 12/24Hr mode bit
- Write new value to RTC Hour register
24hr Mode
Display Value to LCD:
- Display value with Hex2 modifier
Change Hour Value in RTC:
- Convert value from BCD to Decimal
- Change Hour value in Decimal
- Convert Decimal Hour back to BCD
- Write new value to RTC Hour register
Here is a table that shows two hour values in their various permutations.
SampleTable.txt
Hope this helps.
Bookmarks