9-6
MSM66577 Family User's Manual
Chapter 9 Capture/Compare Timer
9.5.2 Description of Capture/Compare Out Module Registers
(1)
Capture/compare registers (CPCMR0, CPCMR1)
The capture/compare registers (CPCMR0 and CPCMR1) consist of 16 bits. In the compare
out mode, CPCMR0 and CPCMR1 are always compared to the value of the free running
counter (FRC). In the capture mode, when the edge specified as valid is input to a CPCMn
pin, a capture event interrupt is generated, and at the same time, the contents of the free
running counter (FRC) are loaded into CPCMR0 and CPCMR1.
CPCMR0 and CPCMR1 can be read from and written to by the program.
When reset (
RES signal input, execution of a BRK instruction, overflow of the watchdog
timer, opcode trap), CPCMR0 and CPCMR1 become 0000H.
(2)
Capture/compare control registers (CPCMCON0, CPCMCON1)
The capture/compare control registers (CPCMCON0 and CPCMCON1) consist of 3 bits.
In the compare out mode, if CPCMR0 and CPCMR1 match the value of the free running
counter (FRC), the contents of CPCMBFn (bit 1) are loaded into CPCMOUTn (bit 0). At the
same time, the contents of CPCMSBFn (bit 2) are loaded into CPCMBFn (bit 1). CPCMBFn
is set to the level (High or Low level) that is desired at the time of the next match.
CPCMCON0 and CPCMCON1 can be read from and written to by the program. However,
write operations are invalid for the upper 5 bits. If read, the value of the upper 5 bits is always
"1".
When reset (
RES signal input, execution of a BRK instruction, overflow of the watchdog
timer, opcode trap), CPCMCON0 and CPCMCON1 become F8H.
Figure 9-5 shows the configuration of CPCMCON0 and CPCMCON1.
7
—
6
—
5
—
4
—
3
—
2
1
0
CPCMSBFn CPCMBFn CPCMOUTn
The contents of this flag are output
to the CPCMn pin.
When the counter value matches
the CPCMRn value, the contents of
this flag are loaded into CPCMOUTn.
CPCMCONn
At reset
Address:
R/W access:
0055 [H] (CPCMCON0)
0056 [H] (CPCMCON1)
R/W
11111000
When the counter value matches
the CPCMRn value, the contents of
this flag are loaded into CPCMBFn.
"—" indicates a nonexistent bit.
If read, its value will be "1."
(n = 0, 1)
Figure 9-5 CPCMCON0 and CPCMCON1 Configuration