III PERIPHERAL BLOCK: CLOCK TIMER
B-III-7-2
EPSON
S1C33L03 FUNCTION PART
Control and Operation of the Clock Timer
Initial setting
At initial reset, the clock timer's counter data, setup contents of alarms, and control bits including RUN/STOP,
are not initialized. (This does not include the CPU core power on/off flag TCHVOF or OSC1 auto-off flag
TCAOFF.)
Therefore, when using the clock timer, initialize it as follows:
1. Before you start setting up, stop the clock timer and disable the clock timer interrupt.
2. Reset the counters.
3. Preset the minute, hour, and day data (only when necessary).
4. Select an interrupt factor.
5. Select the alarm function.
6. Enable the interrupt.
7. Start the clock timer.
The following shows how to set and control each of the above. For details on interrupt control, refer to
"Interrupt Function".
Resetting the counters
Each counter of the clock timer can only be reset to "0" in the software. Note that they are not reset by an
initial reset or the auto-off function.
To reset the clock timer, write "1" to TCRST (D1) / Clock timer Run/Stop register (0x40151). Note, however,
that this reset input is accepted only when the clock timer is inactive, and is ignored when the timer is
operating.
Notes: • The clock timer reset bit TCRST and the clock timer RUN/STOP control bit TCRUN are located
at the same address (0x40151). However, the clock timer cannot be reset at the same time it is
set to RUN by writing "1" to both. In this case, the reset input is ignored and the timer starts
counting up from the counter values then in effect. Always make sure TCRUN = "0" before
resetting the timer.
• When the counters are cleared as the clock timer is reset, an interrupt may be generated
depending on the timer settings. Therefore, first disable the clock timer interrupt before resetting
the clock timer, and after resetting the clock timer, reset the interrupt factor flag, interrupt factor
generation flag, and alarm factor generation flag.
Presetting minute, hour, and day data
The clock timer's minute, hour, and day counters have a data preset function, enabling the desired time and
day to be set.
Table 7.1 Presetting the Counters
Counter
Data register
Preset value
Minute counter
TCHD[5:0] (D[5:0]) / Clock timer minute register (0x40155)
0 to 59
Hour counter
TCDD[4:0] (D[4:0]) / Clock timer hour register (0x40156)
0 to 23
Day counter
TCND[15:0](D[7:0]) / Clock timer day (high-order) register (0x40158)
(D[7:0]) / Clock timer day (low-order) register (0x40157)
0 to 65535
When using the clock timer as an RTC, be sure to set these counter values before starting operating of the
clock timer. For the day counter, set a number of days starting from the reference day (e.g., January 1, 1990).
Summary of Contents for CMOS 32-Bit Single Chip Microcomputer S1C33L03
Page 4: ......
Page 14: ......
Page 15: ...S1C33L03 PRODUCT PART ...
Page 16: ......
Page 147: ...S1C33L03 FUNCTION PART ...
Page 148: ......
Page 149: ...S1C33L03 FUNCTION PART I OUTLINE ...
Page 150: ......
Page 152: ...I OUTLINE INTRODUCTION B I 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 162: ...I OUTLINE LIST OF PINS B I 3 8 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 163: ...S1C33L03 FUNCTION PART II CORE BLOCK ...
Page 164: ......
Page 166: ...II CORE BLOCK INTRODUCTION B II 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 172: ...II CORE BLOCK CPU AND OPERATING MODE B II 2 6 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 176: ...II CORE BLOCK INITIAL RESET B II 3 4 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 224: ...II CORE BLOCK BCU Bus Control Unit B II 4 48 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 262: ...II CORE BLOCK DBG Debug Unit B II 7 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 263: ...S1C33L03 FUNCTION PART III PERIPHERAL BLOCK ...
Page 264: ......
Page 266: ...III PERIPHERAL BLOCK INTRODUCTION B III 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 322: ...III PERIPHERAL BLOCK WATCHDOG TIMER B III 5 4 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 415: ...S1C33L03 FUNCTION PART IV ANALOG BLOCK ...
Page 416: ......
Page 418: ...IV ANALOG BLOCK INTRODUCTION B IV 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 434: ...IV ANALOG BLOCK A D CONVERTER B IV 2 16 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 435: ...S1C33L03 FUNCTION PART V DMA BLOCK ...
Page 436: ......
Page 438: ...V DMA BLOCK INTRODUCTION B V 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 492: ...V DMA BLOCK IDMA Intelligent DMA B V 3 18 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Page 493: ...S1C33L03 FUNCTION PART VI SDRAM CONTROLLER BLOCK ...
Page 494: ......
Page 531: ...S1C33L03 FUNCTION PART VII LCD CONTROLLER BLOCK ...
Page 532: ......
Page 579: ...S1C33L03 FUNCTION PART Appendix I O MAP ...
Page 580: ......