III PERIPHERAL BLOCK: CLOCK TIMER
Setting alarm function
The clock timer has an alarm function, enabling an interrupt to be generated at a specified time and day. This specification can be made in minutes, hours, and days for each alarm or a combination of multiple alarms. Use TCASE[2:0] (D[4:2) / Clock timer interrupt control register (0x40152) for this specification.
Table 7.3 Alarm Factor Selection
TCASE2 | TCASE1 | TCASE0 | Alarm factor |
X | X | 1 | Minutes alarm |
X | 1 | X | Hours alarm |
1 | X | X | Day alarm |
0 | 0 | 0 | None |
For example, if TCASE is set to "001", only a minutes alarm is enabled and an alarm is generated at a specified minute every hour. If TCASE is set to "111", an alarm is generated on each specified day at each specified hour and minute. If alarms are not to be used, set TCASE to "000".
An interrupt can be generated every minute, every hour, and every day through the use of the counter's
interrupt function instead of the alarm function. |
| |
To specify a day, hours, and minutes, use the registers shown below: |
| |
To specify minutes: TCCH[5:0] (D[5:0]) / | 0 to 59 minutes* | |
To specify hours: | TCCD[4:0] (D[4:0]) / | 0 to 23 hours* |
To specify day: | TCCN[4:0] (D[4:0]) / | 0 to 31 days after |
∗The
The values set in these registers are compared with those of each counter, and when they match, the alarm factor generation flag TCAF (D0) / Clock timer interrupt control register (0x40152) is set to "1". If clock timer interrupts have been enabled using the interrupt controller, an interrupt is generated when the flag is set. The
Interrupt Function
Clock timer interrupt factors
The clock timer can generate an interrupt using a
Table 7.4 Selecting Interrupt Factor
TCISE2 | TCISE1 | TCISE0 | Interrupt factor |
1 | 1 | 1 | None |
1 | 1 | 0 | 1 day |
1 | 0 | 1 | 1 hour |
1 | 0 | 0 | 1 minute |
0 | 1 | 1 | 1 Hz |
0 | 1 | 0 | 2 Hz |
0 | 0 | 1 | 8 Hz |
0 | 0 | 0 | 32 Hz |
An interrupt factor is generated at intervals of a selected signal (each falling edge of the signal). If interrupts based on these signals are not to be used, set TCISE to "111".
When a selected interrupt factor is generated, the interrupt factor generation flag TCIF (D1) / Clock timer interrupt control register (0x40152) is set to "1". At the same time, the clock timer interrupt factor flag FCTM (D1) / Port input
EPSON | S1C33L03 FUNCTION PART |