15 CLOCK TIMER (CT)
15-4
EPSON
S1C17704 TECHNICAL MANUAL
15.4 Clock Timer Run/Stop Control
Before starting the clock timer, set up the conditions as shown below.
(1) Set up the interrupt level and enable the clock timer interrupt if the interrupt is used. See Section 15.5.
(2) Reset the timer. See Section 15.3.
The clock timer provides CTRUN (D0/CT_CTL register) to run and stop the counter.
∗
CTRUN
: Clock Timer Run/Stop Control Bit in the Clock Timer Control (CT_CTL) Register (D0/0x5000)
The clock timer starts counting when 1 is written to CTRUN. The clock input is disabled and the timer stops
counting when 0 is written to CTRUN. This control does not affect the counter data (CT_CNT register). Even when
the timer has stopped counting, the counter retains its count so that the timer can start counting again from that
point.
When both CTRUN and CTRST are set to 1 at the same time, the timer starts counting after resetting the counter.
While the timer is running, a cause of interrupt occurs at the falling edge of the 32 Hz, 8 Hz, 2 Hz, and 1 Hz
signals. If the interrupt has been enabled, an interrupt request is sent to the interrupt controller (ITC).
256 Hz
128 Hz
64 Hz
32 Hz
16 Hz
8 Hz
4 Hz
2 Hz
1 Hz
32 Hz interrupt
8 Hz interrupt
2 Hz interrupt
1 Hz interrupt
OSC1•1/128
CTCNT0
CTCNT1
CTCNT2
CTCNT3
CTCNT4
CTCNT5
CTCNT6
CTCNT7
Figure 15.4.1 Timing Chart of Clock Timer
Note
: The clock timer is actually made to Run/Stop in sync with the falling edge of the 256 Hz signal
after writing to CTRUN. Therefore, when 0 is written to the CTRUN, the timer stops after the
counter is incremented. The CTRUN maintains 1 for reading until the timer actually enters Stop
status.
Figure 15.4.2 shows the timer operation at start/stop.
CTRUN(WR)
CT_CNT register
0x57
0x58 0x59 0x5a 0x5b
0x5c
CTRUN(RD)
256 Hz
Figure 15.4.2 Clock Timer Start/Stop Operation
Summary of Contents for S1C17704
Page 1: ...TECHNICAL MANUAL S1C17704 CMOS 16 BIT SINGLE CHIP MICROCOMPUTER ...
Page 22: ...1 OVERVIEW 1 10 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 42: ...3 MEMORY MAP BUS CONTROL 3 12 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 82: ...6 INTERRUPT CONTROLLER ITC 6 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 108: ...8 CLOCK GENERATOR CLG 8 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 112: ...9 PRESCALER PSC 9 4 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 138: ...10 I O PORTS P 10 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 156: ...11 16 BIT TIMERS T16 11 18 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 208: ...14 8 BIT OSC1 TIMER T8OSC1 14 16 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 234: ...16 STOPWATCH TIMER SWT 16 14 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 242: ...17 WATCHDOG TIMER WDT 17 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 264: ...18 UART 18 22 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 300: ...20 I2C 20 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 320: ...21 REMOTE CONTROLLER REMC 21 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 360: ...24 ON CHIP DEBUGGER DBG 24 6 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 362: ...25 BASIC EXTERNAL WIRING DIAGRAM 25 2 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...