Difference between revisions of "LPC1768: RTC Programming"
m |
m |
||
Line 53: | Line 53: | ||
The values of the Time Counters can optionally be read in a consolidated format which | The values of the Time Counters can optionally be read in a consolidated format which | ||
allows the programmer to read all time counters with only three read operations | allows the programmer to read all time counters with only three read operations | ||
+ | |||
+ | |||
+ | =====Consolidated Time Register 0 (CTIME0) ===== | ||
+ | {| class="wikitable" style="text-align:center; background-color:#ABCDEF;margin: 1em auto 1em auto" | ||
+ | !colspan = '9'|CTIME0 | ||
+ | |- | ||
+ | | 31:27 || 24:26 || 23:21 || 20:16 || 15:14 || 13:8 || 7:6 || 5:0 | ||
+ | |- | ||
+ | | Reserved || Day of Week | Reserved || Hours || Reserved || Minute || Reserved || Second | ||
+ | |} | ||
+ | |||
+ | =====Consolidated Time Register 1 (CTIME1) ===== | ||
+ | {| class="wikitable" style="text-align:center; background-color:#ABCDEF;margin: 1em auto 1em auto" | ||
+ | !colspan = '9'|CTIME1 | ||
+ | |- | ||
+ | | 31:27 || 27:16 || 15:12 || 11:8 || 7:5 || 4:0 | ||
+ | |- | ||
+ | | Reserved || Year | Reserved || Month || Reserved || Day of Month | ||
+ | |} | ||
+ | |||
+ | |||
+ | =====Consolidated Time Register 2 (CTIME2) ===== | ||
+ | {| class="wikitable" style="text-align:center; background-color:#ABCDEF;margin: 1em auto 1em auto" | ||
+ | !colspan = '9'|CTIME2 | ||
+ | |- | ||
+ | | 31:12 || 11:0 | ||
+ | |- | ||
+ | | Reserved || Day of Year | ||
+ | |} | ||
=Steps for configuring RTC= | =Steps for configuring RTC= |
Revision as of 20:43, 4 June 2015
---
Objective
RTC Registers
CCR ( Clock Control Register )
CCR | ||||||||
---|---|---|---|---|---|---|---|---|
31:5 | 4 | 3:2 | 1 | 0 | ||||
- | CCALEN | - | CTCRST | CLKEN |
Bit 0 – CLKEN : Clock Enable
Bit 1 - CTCRST : CTC Reset
Bit 3:2
Bit 4 - CCALEN
Bit 31:5
Time Counter Register
Time Counter Register | ||||||||
---|---|---|---|---|---|---|---|---|
Name | Description | Range | ||||||
SEC | Seconds value | 0 to 59 | ||||||
MIN | Minutes value | 0 to 59 | ||||||
HOUR | Hours value | 0 to 23 | ||||||
DOM | Day of Month value | 1 to 28,29,30 or 31 ( depending on the month and whether it is a leap year). | ||||||
DOW | Day of Week value | 0 to 6 | ||||||
DOY | Day of Year value | 1 to 365 (366 for Leap Year) | ||||||
MONTH | Month value | 1 to 12 | ||||||
YEAR | Year value | 0 to 4095 |
Consolidated Time Registers
The values of the Time Counters can optionally be read in a consolidated format which allows the programmer to read all time counters with only three read operations
Consolidated Time Register 0 (CTIME0)
CTIME0 | ||||||||
---|---|---|---|---|---|---|---|---|
31:27 | 24:26 | 23:21 | 20:16 | 15:14 | 13:8 | 7:6 | 5:0 | |
Reserved | Reserved | Hours | Reserved | Minute | Reserved | Second |
Consolidated Time Register 1 (CTIME1)
CTIME1 | ||||||||
---|---|---|---|---|---|---|---|---|
31:27 | 27:16 | 15:12 | 11:8 | 7:5 | 4:0 | |||
Reserved | Reserved | Month | Reserved | Day of Month |
Consolidated Time Register 2 (CTIME2)
CTIME2 | ||||||||
---|---|---|---|---|---|---|---|---|
31:12 | 11:0 | |||||||
Reserved | Day of Year |
Steps for configuring RTC
Code EXample
Example 1
Using Explore Embedded Liberaries