BASIC TIMER and TIMER 0
KS86C6004/C6008/P6008 MICROCONTROLLER (Preliminary Spec)
10-6
TIMER 0 CONTROL REGISTER (T0CON)
T0CON is located at address D2H, and is read/write addressable.
A reset clears T0CON to '00H'. This sets timer 0 to normal interval match mode, selects an input clock frequency
of f
OSC
/4096, and disables the timer 0 overflow interrupt and match interrupt. You can clear the timer 0 counter
at any time during normal operation by writing a "1" to T0CON.3.
The timer 0 overflow interrupt can be enabled by writing a "1" to T0CON.1. When a timer 0 overflow interrupt
occurs and is serviced by the CPU, the pending condition must be cleared by software by writing a "0" to the
timer 0 interrupt pending bit, T0CON.0.
To enable the timer 0 match interrupt, you must write T0CON.1 to "1". To detect an interrupt pending condition,
the application program polls T0CON.0. When a "1" is detected, a timer 0 match/ capture interrupt is pending.
When the interrupt request has been serviced, the pending condition must be cleared by software by writing a "0"
to the timer 0 interrupt pending bit, T0CON.0.
MSB
LSB
.7
.6
.5
.4
.3
.2
.1
.0
TIMER 0 CONTROL REGISTER (T0CON)
D2H, R/W
Timer 0 interrupt pending bit:
0 = No interrupt pending
0 = Clear pending bit (when write)
1 = Interrupt is pending (when read)
No effect (when write)
Timer 0 match interrupt enable bit:
0 = Disable match interrupt
1 = Enable match interrupt
Timer 0 overflow interrupt enable bit:
0 = Disable overflow interrupt
1 = Enable overflow interrupt
Timer 0 counter clear bit:
0 = No effect
1 = Clear the timer 0 counter (when write)
Timer 0 input clock selection bits:
00 = f
OSC
/4096
01 = f
OSC
/256
10 = f
OSC
/8
11 = Invalid selection
Timer 0 operating mode selection bits:
00 = Interval match mode
01 = Invalid selection
10 = Invalid selection
11 = Overflow mode
Figure 10-4. Timer 0 Control Register (T0CON)
Summary of Contents for KS86C6004
Page 19: ...ADDRESS SPACES KS86C6004 C6008 P6008 MICROCONTROLLER Preliminary Spec 2 8 NOTES ...
Page 61: ...CONTROL REGISTERS KS86C6004 C6008 P6008 MICROCONTROLLER Preliminary Spec 4 30 NOTES ...
Page 120: ...CLOCK CIRCUIT KS86C6004 C6008 P6008 MICROCONTROLLERS Preliminary Spec 7 4 NOTES ...
Page 134: ...I O PORTS KS86C6004 C6008 P6008 MICROCONTROLLER Preliminary Spec 9 10 NOTES ...
Page 143: ...KS86C6004 C6008 P6008 MICROCONTROLLER Preliminary Spec BASIC TIMER and TIMER 0 10 9 NOTES ...
Page 162: ...KS86C6004 C6008 P6008 MICROCONTROLLER Preliminary Spec ELECTRICAL DATA 12 9 ...
Page 164: ...KS86C6004 C6008 P6008 MICROCONTROLLER Preliminary Spec ELECTRICAL DATA 12 11 NOTES ...
Page 172: ...KS86P6008 OTP KS86C6004 C6008 P6008 MICROCONTROLLER Preliminary Spec 14 6 NOTES ...