
TIMER M0
S3C8639/C863A/P863A/C8647/F8647
11-2
Timer M0 Control Register (TM0CON)
You use the timer M0 control register, TM0CON, to
— Select the timer M0 operating mode (capture mode)
— Select the timer M0 input clock frequency
— Clear the timer M0 counter, TM0CNT
— Enable the timer M0 overflow interrupt and timer M0 capture interrupt
— Select a 2-bit prescaler value for the Timer M0 input clock
— Select the timer M0 capture input source
TM0CON is located in set 1, at address D2H, and is read/write addressable using Register addressing mode.
A reset clears TM0CON to "00H". This sets timer M0 to disable capture timer mode, selects an input clock
frequency of f
OSC/128, and disables timer M0 overflow and capture interrupts. You can clear the timer M0
counter at any time during the normal operation by writing a "1" to TM0CON.2.
The timer M0 overflow interrupt (TM0OVF) is in the interrupt level IRQ0 and has the vector address E0H. When
the timer M0 capture interrupt is disabled, the Timer M0 overflow interrupt by clock (f
OSC) is possible. When a
timer M0 overflow interrupt occurs and is serviced by the CPU, the pending condition is cleared automatically by
hardware.
To enable the timer M0 capture interrupt (IRQ0, vector E2H), you must write TM0CON.1 to "1". There is no
pending bit cleared by software or static read bit which is H/W pending. After the interrupt request is serviced, the
pending condition is automatically cleared by hardware.
Timer M0 Control Register (TM0CON)
D2H, Set 1, R/W
.7
.6
.5
.4
.3
.2
.1
.0
MSB
LSB
Timer M0 input clock
selection bit:
0 = fOSC/128
1 = fOSC/8
Timer M0 capture input selection bit:
0 = TM0CAP input pin selection
1 = V-sync output path selection from
sync-processor
Timer M0 capture interrupt enable bit:
0 = Disable the timer M0 capture interrupt
1 = Enable the timer M0 capture interrupt
Timer M0 capture mode selection bit:
0 = Capture on rising mode
1 = Capture on falling mode
Timer M0 overflow interrupt enable bit:
0 = Disable the timer M0 overflow interrupt
1 = Enable the timer M0 overflow interrupt
2-bit prescaler bits:
00 = No division
01 = Divide by 2
10 = Divide by 3
11 = Divide by 4
Timer M0 counter clear bit:
0 = No effect
1 = Clear timer M0 counter (when write)
NOTE:
When the captured value is #0FFh, the overflow interrupt does not occur.
When the vlaue of capture is changed from #0FFh to #00h, the overflow interrupt
always occurs. When the captured value is #00h, the overflow interrupt occurs in
advance.
Figure 11-1. Timer M0 Control Register (TM0CON)