HYUNDAI MicroElectronics | GMS90X5XC Series |
TIMER / COUNTER 0 AND 1
Timer/Counter 0 and 1 can be used in four operating modes as listed in Table 4:
Table 4. Timer/Counter 0 and 1 Operating Modes
Mode | Description |
|
| TMOD |
| Input Clock | |||
|
|
|
|
|
|
|
| ||
|
| Gate | C/T |
| M1 | M0 | internal | external (Max.) | |
|
|
|
|
|
|
|
|
| |
0 | X | X |
| 0 | 0 | fOSC ÷(12×32) | fOSC ÷(24×32) | ||
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
| |
1 | X | X |
| 0 | 1 | fOSC ÷12 | fOSC ÷24 | ||
2 | X | X |
| 1 | 0 | fOSC ÷12 | fOSC ÷24 | ||
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
| |
3 | Timer/counter 0 used as | X | X |
| 1 | 1 | fOSC ÷12 | fOSC ÷24 | |
| one |
|
|
|
|
|
|
|
|
| one |
|
|
|
|
|
|
|
|
| stops |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In the "timer" function (C/T = "0") the register is incremented every machine cycle. Therefore the count rate is fOSC/12.
In the "counter" function the register is incremented in response to a
fOSC |
|
| ÷ 12 |
|
| ||
|
|
|
|
C/T
TMOD
0
P3.4/T0 |
|
|
|
|
|
|
|
|
|
|
|
| ||||||
P3.5/T1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| ||||
Max. fOSC/24 |
|
|
|
|
|
|
|
|
| |||||||||
|
|
|
|
|
|
|
|
| ||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| TR0 / 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| TCON |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
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