The DS1302 can be run in either 12-hour or 24-hour mode. Bit 7 of the hours register is defined as the 12- or 24-hour mode-select bit. When high, the 12-hour mode is selected. In the 12-hour mode, bit 5 is the AM/PM bit with logic high being PM. In the 24-hour mode, bit 5 is the second 10-hour bit (20–23 hours). The hours data must be re-initialized whenever the 12/24 bit is changed.
DS1302可以以12小时制或24小时制模式运行。小时寄存器的第7位被定义为12小时制或24小时制模式选择位。当该位为高电平时,选择12小时制模式。在12小时制模式下,第5位是AM/PM位,逻辑高电平表示PM。在24小时制模式下,第5位是第二个10小时位(20-23小时)。每当12/24位发生变化时,小时数据必须重新初始化。 |