
8-BIT TIMER A/B
S3C828B/F828B/C8289/F8289/C8285/F8285
11-2
TIMER A CONTROL REGISTER (TACON)
You use the timer A control register, TACON, to
— Select the timer A operating mode (interval timer, capture mode, or PWM mode)
— Select the timer A input clock frequency
— Clear the timer A counter, TACNT
— Enable the timer A overflow interrupt or timer A match/capture interrupt
— Clear timer A match/capture interrupt pending condition
TACON is located in set 1, Bank 0 at address E8H, and is read/write addressable using Register addressing
mode.
A reset clears TACON to '00H'. This sets timer A to normal interval timer mode, selects an input clock frequency
of fxx/1024, and disables all timer A interrupts. You can clear the timer A counter at any time during normal
operation by writing a "1" to TACON.2.
The timer A overflow interrupt (TAOVF) is interrupt level IRQ0 and has the vector address DEH. When a timer A
overflow interrupt occurs and is serviced by the CPU, the pending condition is cleared automatically by hardware
or must be cleared by software.
To enable the timer A match/capture interrupt (IRQ0, vector DCH), you must write TACON.1 to "1". To detect a
match/capture interrupt pending condition, the application program polls INTPND.1. When a "1" is detected, a
timer A match or 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 A match/capture interrupt pending bit,
INTPND.1.
Timer A Control Register (TACON)
E8H, Set 1, Bank 0, R/W
.7
.6
.5
.4
.3
.2
.1
.0
MSB
LSB
Timer A match/capture interrupt enable bit:
0 = DIsable interrupt
1 = Enable interrupt
Timer A overflow interrupt enable bit:
0 = Disable oveflow interrupt
1 = Enable overflow interrupt
Timer A counter clear bit:
0 = No effect
1 = Clear the timer A counter (when write)
Timer A input clock selection bits:
000 = fxx/1024
001 = fxx/256
010 = fxx/64
011 = fxx/8
100 = fxx/1
101 = External clock (TACLK) falling edge
110 = External clock (TACLK) rising edge
111 = Counter stop
Timer A operating mode selection bits:
00 = Interval mode (TAOUT)
01 = Capture mode (capture on rising edge,
Counter running, OVF can occur)
10 = Capture mode (Capture on falling edge,
Counter running, OVF can occur)
11 = PWM mode (OVF interrupt can occur)
Figure 11-1. Timer A Control Register (TACON)