
ML66517 Family User’s Manual
Chapter 9
Capture/Compare Timer
9 – 17
Compare out mode settings
(1) External interrupt control register 1 (EXI1CON)
If the capture/compare timer is to be used, write 55H to EXI1CON.
(2) Port 17 mode register (P17IO)
If CPCMF0 is to be set to the compare out mode, set bit 2 (P17IO2) to “1” to configure the port as an
output. If CPCMF1 is to be set to the compare out mode, set bit 3 (P17IO3) to “1” to configure the port as
an output.
(3) Port 17 secondary function control register (P17SF)
If CPCMF0 is to be set to the compare out mode, set bit 2 (P17SF2) to “1” to configure the port as a
secondary function output. If CPCMF1 is to be set to the compare out mode, set bit 3 (P17SF3) to “1” to
configure the port as a secondary function output.
(4) Capture/compare control register (CPCMCON)
If CPCMF0 is to be set to the compare out mode, reset bit 4 (CP0MD) to “0”. If CPCMF1 is to be set to the
compare out mode, reset bit 5 (CP1MD) to “0”.
(5) Compare control register 0 (CMPCON0)
Specify with bit 0 (CMPOUT0) the initial value to be output to the CPCMF0 pin, and specify with bit 1
(CMPBF0) the value desired to be output from the CPCMF0 pin when the value of the free running counter
matches the contents of the CPCMR0. Specify with bit 2 (CMPSBF0) the value desired to be output from
the CPCMF0 pin the next time the value of the free running counter matches the contents of the CPCMR0.
(6) Compare control register 1 (CMPCON1)
Specify with bit 0 (CMPOUT1) the initial value to be output to the CPCMF1 pin, and specify with bit 1
(CMPBF1) the value desired to be output from the CPCMF1 pin when the value of the free running counter
matches the contents of the CPCMR1. Specify with bit 2 (CMPSBF1) the value desired to be output from
the CPCMF1 pin the next time the value of the free running counter matches the contents of the CPCMR1.
(7) Capture/compare interrupt control register (CPCMINT)
If CPCMF0 compare matches are to generate interrupts, set bit 2 (CPCMIE0) to “1” to enable CPCMF0
interrupts. If CPCMF1 compare matches are to generate interrupts, set bit 3 (CPCMIE1) to “1” to enable
CPCMF1 interrupts. The generation of a CPCMF0 or CPCMF1 compare match will set the respective bit 0
(INTCPCM0) or bit 1 (INTCPCM1) to “1”, and since these bits are not reset by the hardware, they must be
reset to “0” by the program.
(8) Free running counter (FRC)
The initial value at the start of counting can be set by writing an arbitrary 16-bit value. During counting,
reading from and writing to the FRC is possible.
(9) Capture/compare register 0 (CPCMR0)
If CPCMF0 has been set to the compare out mode, CPCMR0 specifies the count value at which output of
the CPCMF0 pin will change.
(10) Capture/compare register 1 (CPCMR1)
If CPCMF1 has been set to the compare out mode, CPCMR1 specifies the count value at which output of
the CPCMF1 pin will change.
(11) Capture/compare buffer register 0 (CPCMBFR0)
If CPCMF0 has been set to the compare out mode, CPCMBFR0 specifies the next count value of CPCMR0
at which output of the CPCMF0 pin will change.
(12) Capture/compare buffer register 1 (CPCMBFR1)
If CPCMF1 has been set to the compare out mode, CPCMBFR1 specifies the next count value of CPCMR1
at which output of the CPCMF1 pin will change.