Reading the DS1337 Datasheet if bit 6 is High (1) 12hr mode is selected. See snippet from the Datasheet below.
"The DS1337 can be run in either 12-hour or 24-hour mode. Bit 6 of the hours register is defined as the 12- or 24-hour mode-select bit. When high, the 12-hour mode is selected."
With or without refers to the need, when in 12Hr mode, to mask off(set to 0) BOTH the 12/24Hr and AM/PM bits when using LCDOUT, SEROUT, HSEROUT, etc ; and when changing the value of the Hours in your code to be written back to the RTC. Such as when you allow the user to change the time via buttons.
With = Bits ARE NOT masked ( leads to errors)
Without = Bits ARE masked
Not performing these actions when needed during hour value manipulation and displaying the values will lead to incorrect settings in the RTC and visually strange clock display. E.g. 44 being displayed on the LCD instead of the expected 4 AM or 64 being displayed on the LCD instead of expected 4 PM.




Bookmarks