
306
Chapter 8
16-Bit Timer/Event Counter Q
User’s Manual U16702EE3V2UD00
(1)
Capture/compare register 0 (TQnCCR0)
The TQnCCR0 register is a 16-bit register that has a capture function and a compare function.
Whether this register is used as a capture register or a compare register can be specified by using
the TQnCCS0 bit of the TQnOPT0 register, but only in the free-running mode.
In the pulse width measurement mode, this register can be used only as a capture register (it
cannot be used as a compare register).
In all the modes other than the free-running mode and pulse width measurement mode, this
register functions as a compare register.
In the default status, the TQnCCR0 register functions as a compare register.
This register can be read or written in 16-bit units.
RESET input clears this register to 0000H.
Figure 8-2:
Capture/Compare Register 0 (TQnCCR0) Format
•
When used as a compare register
TQnCCR0 can be rewritten when TQnCE = 1 as below mentioned:
•
When used as capture register
The count value is stored in TQnCCR0 upon capture trigger (TIQn0) input edge detection.
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Address
R/W
Initial
value
TQ0CCR0
FFFF F546H
R/W 0000H
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Address
R/W
Initial
value
TQ1CCR0
FFFF F616H
R/W 0000H
TMQ Operation Mode
Method of Writing TQnCCR0 Register
PWM output mode, external trigger pulse output mode,
or triangular wave PWM mode
Reload
Free-running mode, external event count mode,
one-shot pulse mode or interval timer mode
Any time write
Pulse width measurement mode
Cannot be used because used only as capture register
electronic components distributor