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).
Содержание CMOS 32-Bit Single Chip Microcomputer S1C33L03
Страница 4: ......
Страница 14: ......
Страница 15: ...S1C33L03 PRODUCT PART ...
Страница 16: ......
Страница 147: ...S1C33L03 FUNCTION PART ...
Страница 148: ......
Страница 149: ...S1C33L03 FUNCTION PART I OUTLINE ...
Страница 150: ......
Страница 152: ...I OUTLINE INTRODUCTION B I 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 162: ...I OUTLINE LIST OF PINS B I 3 8 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 163: ...S1C33L03 FUNCTION PART II CORE BLOCK ...
Страница 164: ......
Страница 166: ...II CORE BLOCK INTRODUCTION B II 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 172: ...II CORE BLOCK CPU AND OPERATING MODE B II 2 6 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 176: ...II CORE BLOCK INITIAL RESET B II 3 4 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 224: ...II CORE BLOCK BCU Bus Control Unit B II 4 48 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 250: ...II CORE BLOCK ITC Interrupt Controller B II 5 26 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 262: ...II CORE BLOCK DBG Debug Unit B II 7 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 263: ...S1C33L03 FUNCTION PART III PERIPHERAL BLOCK ...
Страница 264: ......
Страница 266: ...III PERIPHERAL BLOCK INTRODUCTION B III 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 292: ...III PERIPHERAL BLOCK 8 BIT PROGRAMMABLE TIMERS B III 3 18 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 318: ...III PERIPHERAL BLOCK 16 BIT PROGRAMMABLE TIMERS B III 4 26 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 322: ...III PERIPHERAL BLOCK WATCHDOG TIMER B III 5 4 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 414: ...III PERIPHERAL BLOCK INPUT OUTPUT PORTS B III 9 26 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 415: ...S1C33L03 FUNCTION PART IV ANALOG BLOCK ...
Страница 416: ......
Страница 418: ...IV ANALOG BLOCK INTRODUCTION B IV 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 434: ...IV ANALOG BLOCK A D CONVERTER B IV 2 16 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 435: ...S1C33L03 FUNCTION PART V DMA BLOCK ...
Страница 436: ......
Страница 438: ...V DMA BLOCK INTRODUCTION B V 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 492: ...V DMA BLOCK IDMA Intelligent DMA B V 3 18 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 493: ...S1C33L03 FUNCTION PART VI SDRAM CONTROLLER BLOCK ...
Страница 494: ......
Страница 496: ...VI SDRAM CONTROLLER BLOCK INTRODUCTION B VI 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 531: ...S1C33L03 FUNCTION PART VII LCD CONTROLLER BLOCK ...
Страница 532: ......
Страница 534: ...VII LCD CONTROLLER BLOCK INTRODUCTION B VII 1 2 EPSON S1C33L03 FUNCTION PART THIS PAGE IS BLANK ...
Страница 579: ...S1C33L03 FUNCTION PART Appendix I O MAP ...
Страница 580: ......