|
BQ4285E_14 Datasheet, PDF (5/31 Pages) Texas Instruments – Enhanced RTC With NVRAM Control | |||
|
◁ |
bq4285E/L
Programming the RTC
The time-of-day, alarm, and calendar bytes can be written
in either the BCD or binary format (see Table 2).
These steps may be followed to program the time, alarm,
and calendar:
1. Modify the contents of register B:
a. Write a 1 to the UTI bit to prevent trans-
fers between RTC bytes and user buffer.
b. Write the appropriate value to the data for-
mat (DF) bit to select BCD or binary format
for all time, alarm, and calendar bytes.
c. Write the appropriate value to the hour
format (HF) bit.
2. Write new values to all the time, alarm, and
calendar locations.
3. Clear the UTI bit to allow update transfers.
On the next update cycle, the RTC updates all 10 bytes
in the selected format.
Square-Wave Output
The bq4285E/L divides the 32.768kHz oscillator fre-
quency to produce the 1 Hz update frequency for the
clock and calendar. Thirteen taps from the frequency di-
vider are fed to a 16:1 multiplexer circuit. The output of
this mux is fed to the SQW output and periodic inter-
rupt generation circuitry. The four least-significant bits
of register A, RS0âRS3, select among the 13 taps (see
Table 3). The square-wave output is enabled by writing
a 1 to the square-wave enable bit (SQWE) in register B.
A 32.768kHz output may be selected by setting
OSC2âOSC0 in register A to 011 while SQWE = 1 and
32KE = 1.
Table 2. Time, Alarm, and Calendar Formats
Address
0
1
2
3
4
5
6
7
8
9
RTC Bytes
Seconds
Seconds alarm
Minutes
Minutes alarm
Hours, 12-hour format
Hours, 24-hour format
Hours alarm, 12-hour format
Hours alarm, 24-hour format
Day of week (1=Sunday)
Day of month
Month
Year
Decimal
0â59
0â59
0â59
0â59
1â12
0â23
1â12
0â23
1â7
1â31
1â12
0â99
Range
Binary
00Hâ3BH
00Hâ3BH
00Hâ3BH
00Hâ3BH
01HâOCH AM;
81Hâ8CH PM
00Hâ17H
01HâOCH AM;
81Hâ8CH PM
00Hâ17H
01Hâ07H
01Hâ1FH
01Hâ0CH
00Hâ63H
Binary-Coded
Decimal
00Hâ59H
00Hâ59H
00Hâ59H
00Hâ59H
01Hâ12H AM;
81Hâ92H PM
00Hâ23H
01Hâ12H AM;
81Hâ92H PM
00Hâ23H
01Hâ07H
01Hâ31H
01Hâ12H
00Hâ99H
5
|
▷ |