Datasheet
2010-2014 Microchip Technology Inc. DS20005010F-page 21
MCP7940N
5.4.1 CONFIGURING THE ALARM
In order to configure the alarm modules, the following
steps need to be performed:
1. Load the timekeeping registers and enable the
oscillator
2. Configure the ALMxMSK<2:0> bits to select the
desired alarm mask
3. Set or clear the ALMPOL bit according to the
desired output polarity
4. Ensure the ALMxIF flag is cleared
5. Based on the selected alarm mask, load the
alarm match value into the appropriate regis-
ter(s)
6. Enable the alarm module by setting the
ALMxEN bit
REGISTER 5-8: ALMxSEC: ALARM0/1 SECONDS VALUE REGISTER (ADDRESSES 0x0A/0x11)
U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— SECTEN2 SECTEN1 SECTEN0 SECONE3 SECONE2 SECONE1 SECONE0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is clear x = Bit is unknown
bit 7 Unimplemented: Read as ‘0’
bit 6-4 SECTEN<2:0>: Binary-Coded Decimal Value of Second’s Tens Digit
Contains a value from 0 to 5
bit 3-0 SECONE<3:0>: Binary-Coded Decimal Value of Second’s Ones Digit
Contains a value from 0 to 9
REGISTER 5-9: ALMxMIN: ALARM0/1 MINUTES VALUE REGISTER (ADDRESSES 0x0B/0x12)
U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— MINTEN2 MINTEN1 MINTEN0 MINONE3 MINONE2 MINONE1 MINONE0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is clear x = Bit is unknown
bit 7 Unimplemented: Read as ‘0’
bit 6-4 MINTEN<2:0>: Binary-Coded Decimal Value of Minute’s Tens Digit
Contains a value from 0 to 5
bit 3-0 MINONE<3:0>: Binary-Coded Decimal Value of Minute’s Ones Digit
Contains a value from 0 to 9