Real-Time Clock Operation
14-5
Real Time Clock
14.2.2 Calendar Mode
Calendar mode is selected when RTCMODEx = 11. In calendar mode the RTC
provides seconds, minutes, hours, day of week, day of month, month, and year
in selectable BCD or hexadecimal format. Switching from counter to calendar
mode clears the seconds, minutes, hours, day-of-week, and year counts and
sets day-of-month and month counts to 1.
When RTCBCD = 1, BCD format is selected for the calendar registers. The
format must be selected before the time is set. Changing the state of RTCBCD
clears the seconds, minutes, hours, day-of-week, and year counts and sets
day-of-month and month counts to 1.
The calendar includes a leap year algorithm that considers all years evenly
divisible by 4 as leap years. This algorithm is accurate from the year 1901
through 2099.
Note: Accessing the Real-Time Clock registers
When the counter clock is asynchronous to the CPU clock, any read from any
counting register should occur while the counter is not operating. Otherwise,
the results may be unpredictable. Alternatively, the counter may be read
multiple times while operating, and a majority vote taken in software to
determine the correct reading.
Any write to any counting register takes effect immediately. However the
clock is stopped during the write. This could result in losing up to one second
during a write. Writing of data outside the legal ranges results in
unpredictable behavior.
The RTC does not provide an alarm function. It can easily be implemented in
software if required.
14.2.3 RTC and Basic Timer1 Interaction
In calendar mode the Basic Timer1 is automatically configured as a pre-divider
for the RTC module with the two 8-bit timers cascaded and ACLK selected as
the Basic Timer1 clock source. The BTSSEL, BTHOLD and BTDIV bits are
ignored and RTCHOLD controls both the RTC and the Basic Timer1.
RTC and Basic Timer1 interrupts interact as described in Section 14.2.4,
Real-Time Clock Interrupts.
Summary of Contents for MSP430x4xx Family
Page 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Page 2: ......
Page 6: ...vi ...
Page 114: ...3 76 RISC 16 Bit CPU ...
Page 304: ...5 20 FLL Clock Module ...
Page 340: ...7 8 Supply Voltage Supervisor ...
Page 348: ...8 8 16 Bit Hardware Multiplier ...
Page 372: ...9 24 32 Bit Hardware Multiplier ...
Page 400: ...10 28 DMA Controller ...
Page 428: ...13 10 Basic Timer1 ...
Page 466: ...15 24 Timer_A ...
Page 522: ...17 30 USART Peripheral Interface UART Mode ...
Page 544: ...18 22 USART Peripheral Interface SPI Mode ...
Page 672: ...23 12 Comparator_A ...
Page 692: ...24 20 LCD Controller ...
Page 746: ...26 28 ADC12 ...