Download MCF5373 Reference Manual

Transcript
Real-Time Clock
24.5
24.5.1
Initialization/Application Information
Flow Chart of RTC Operation
Table 24-12 shows the flow chart of a typical RTC operation.
Apply RTC Oscillator Clock
Configure RTC_CR
Configure RTC_DAYS
Configure RTC_SECONDS
Configure RTC_HOURMIN
Configure RTC Alarm Registers
Configure RTC_IER
Check RTC_ISR
Figure 24-12. Flow Chart of RTC Operation
24.5.2
Programming the Alarm or Time-of-Day Registers
Use the following procedure illustrated in Figure 24-13 when changing the alarm or time-of-day (day,
hour, minute, and second) registers.
Disable the alarm interrupt
(clear RTC_IER[ALM])
Program the alarm or time-of-day registers
Clear any incidental alarm interrupt
during programming
(write 1 to RTC_ISR[ALM])
Enable the alarm interrupt
(set RTC_IER[ALM]
Figure 24-13. Flow Chart of Alarm and Time-of-Day Programming
MCF5373 Reference Manual, Rev 3
24-12
Freescale Semiconductor