![Texas Instruments AM1808 Скачать руководство пользователя страница 1323](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_10945581323.webp)
Architecture
1323
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Real-Time Clock (RTC)
After writing to a time/calendar register, the RTC requires four peripheral clock cycles to update the
register value. Any reads that take place within four peripheral clock cycles of a write returns old data.
Note that all registers in the RTC except for KICK
n
R have write-protection. See
for
information on unlocking registers.
27.2.4.2 Real-Time Clock Update Cycle
The RTC executes an update cycle once per second to update the current time in the time/calendar
registers. The update cycle also compares each alarm register with the corresponding time register. These
comparisons are done to determine when to trigger an alarm. The BUSY bit in the status register
(STATUS) provides a mechanism to indicate when the time/calendar registers are updated. When the
BUSY bit is high, an update takes place within 15
μ
s. When BUSY returns low again, the update has been
completed.
The BUSY bit should be checked when writing to any of the following registers while RTC is running:
•
SECOND
•
MINUTE
•
HOUR
•
DAY
•
MONTH
•
YEAR
•
DOTW
•
ALARMSECOND (when ALARM interrupt is enabled)
•
ALARMMINUTE (when ALARM interrupt is enabled)
•
ALARMHOUR (when ALARM interrupt is enabled)
•
ALARMDAY (when ALARM interrupt is enabled)
•
ALARMMONTH (when ALARM interrupt is enabled)
•
ALARMYEAR (when ALARM interrupt is enabled)
•
CTRL (SET32COUNTER field only -- the other fields in CTRL do not require BUSY to be low)
•
INTERRUPT
•
COMPLSB (when oscillator drift compensation is enabled)
•
COMPMSB (when oscillator drift compensation is enabled)
27.2.4.3 Oscillator Drift Compensation
If the RTC 32.768-kHz reference clock is susceptible to oscillator drift, the RTC provides the ability to
compensate the update cycle by subtracting oscillator periods. The COMPMSB and COMPLSB registers
hold the number of two's complement reference periods to subtract from the update cycle every hour. For
example,
shows how programming the value of 2h into the compensation registers shortens
the update cycle by two 32.786-kHz reference periods every hour.
also shows how
programming the value of FFFEh (decimal negative 2) into the compensation register lengthens the
update cycle by two reference periods every hour. To enable the oscillator compensation, the
AUTOCOMP bit in the control register (CTRL) must be set.