Datasheet
dsPIC33EPXXX(GP/MC/MU)806/810/814 and PIC24EPXXX(GP/GU)810/814
DS70616F-page 448 Preliminary © 2009-2012 Microchip Technology Inc.
26.1 Writing to the RTCC Timer
The user application can configure the time and
calendar by writing the desired seconds, minutes,
hours, weekday, date, month, and year to the RTCC
registers. Under normal operation, writes to the RTCC
timer registers are not allowed. Attempted writes will
appear to execute normally, but the contents of the
registers will remain unchanged. To write to the RTCC
register, the RTCWREN bit (RCFGCAL<13>) must be
set. Setting the RTCWREN bit allows writes to the
RTCC registers. Conversely, clearing the RTCWREN
bit prevents writes.
To set the RTCWREN bit, the following procedure must
be executed. The RTCWREN bit can be cleared at any
time:
1. Write 0x55 to NVMKEY.
2. Write 0xAA to NVMKEY.
3. Set the RTCWREN bit using a single cycle
instruction.
The RTCC module is enabled by setting the RTCEN bit
(RCFGCAL<15>). To set or clear the RTCEN bit, the
RTCWREN bit (RCFGCAL<13>) must be set.
If the entire clock (hours, minutes, and seconds) needs
to be corrected, it is recommended that the RTCC
module should be disabled to avoid coincidental write
operation when the timer increment. Therefore, it stops
the clock from counting while writing to the RTCC Timer
register.
26.2 RTCC Resources
Many useful resources related to RTCC are provided
on the main product page of the Microchip web site for
the devices listed in this data sheet. This product page,
which can be accessed using this link, contains the
latest updates and additional information.
26.2.1 KEY RESOURCES
• Section 29. “Real-Time Clock and Calendar
(RTCC)” (DS70584)
• Code Samples
• Application Notes
• Software Libraries
• Webinars
• All related dsPIC33E/PIC24E Family Reference
Manuals Sections
• Development Tools
Note: To allow the RTCC module to be clocked
by the secondary crystal oscillator, the
Secondary Oscillator Enable (LPOSCEN)
bit in the Oscillator Control
(OSCCON<1>) register must be set. For
further details, refer to
Section 7. “Oscillator” (DS70580) in the
'dsPIC33E/PIC24E Family Reference
Manual'.
Note: In the event you are not able to access the
product page using the link above, enter
this URL in your browser:
http://www.microchip.com/wwwproducts/
Devices.aspx?dDocName=en554310