Function; Timer Mode - Philips CEM2100/00 Service Manual

Mini system
Hide thumbs Also See for CEM2100/00:
Table of Contents

Advertisement

8. 16-Bit TimerCounter 1 (TC1)

8.3 Function

8.3 Function
TimerCounter 1 has six types of operating modes: timer, external trigger timer, event counter, window, pulse width
measurement, programmable pulse generator output modes.

8.3.1 Timer mode

In the timer mode, the up-counter counts up using the internal clock. When a match between the up-counter and the timer
register 1A (TC1DRA) value is detected, an INTTC1 interrupt is generated and the up-counter is cleared. After being
cleared, the up-counter restarts counting. Setting TC1CR<ACAP1> to "1" captures the up-counter value into the timer reg-
ister 1B (TC1DRB) with the auto-capture function. Use the auto-capture function in the operative condition of TC1. A cap-
tured value may not be fixed if it's read after the execution of the timer stop or auto-capture disable. Read the capture value
in a capture enabled condition. Since the up-counter value is captured into TC1DRB by the source clock of up-counter after
setting TC1CR<ACAP1> to "1". Therefore, to read the captured value, wait at least one cycle of the internal source clock
before reading TC1DRB for the first time.
Table 8-1 Internal Source Clock for TimerCounter 1 (Example: fc = 16 MHz, fs = 32.768 kHz)
TC1CK
00
01
10
Example 1 :Setting the timer mode with source clock fc/2
Example 2 :Auto-capture
Note: Since the up-counter value is captured into TC1DRB by the source clock of up-counter after setting TC1CR<ACAP1> to "1".
NORMAL1/2, IDLE1/2 mode
DV7CK = 0
Resolution
Maximum Time Setting
[µs]
[s]
128
8.39
8.0
0.524
0.5
32.77 m
(fc = 16 MHz, TBTCR<DV7CK> = "0")
LDW
(TC1DRA), 1E84H
DI
SET
(EIRL). 5
EI
LD
(TC1CR), 00000000B
LD
(TC1CR), 00010000B
LD
(TC1CR), 01010000B
:
:
LD
WA, (TC1DRB)
Therefore, to read the captured value, wait at least one cycle of the internal source clock before reading TC1DRB for the first
time.
DV7CK = 1
Resolution
Maximum Time Setting
[µs]
244.14
8.0
0.524
0.5
32.77 m
11
[Hz] and generating an interrupt 1 second later
; Sets the timer register (1 s ÷ 2
; IMF= "0"
; Enables INTTC1
; IMF= "1"
; Selects the source clock and mode
; Starts TC1
; ACAP1 ← 1
; Reads the capture value
Page 80
T5CL8
SLOW, SLEEP mode
Maximum
Resolution
Time Set-
[s]
[µs]
ting [s]
16.0
244.14
16.0
11
/fc = 1E84H)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cem2100Cem2100/98

Table of Contents