R01UH0092EJ0110 Rev.1.10
Page 444 of 807
Jul 31, 2012
M16C/64C Group
22. Remote Control Signal Receiver
22.3.5.1
Setting Procedure
To start or stop counting, follow these steps:
(1) Set bits CSRC1 to CSRC0 and bits CDIV1 to CDIV0 in the PMCiCON3 register.
(2) Set bits PSEL1 to PSEL0 in the PMCiCON2 register and bits FIL and SINV in the PMCiCON0
register.
(3) Wait for four cycles of the count source.
(4) Set the EN bit in the PMC1CON0 register to 1 (0 to stop).
(5) Set the EN bit in the PMC0CON0 register to 1 (0 to stop).
(6) Wait for two cycles of the count source.
(7) Confirm that the ENFLG bit in the PMC0CON2 register is 1 (0 to stop). (The ENFLG bit in the
PMC1CON2 register is disabled)
22.3.5.2
Count Operation
In input capture mode, the counter counts from 0000h to FFFFh, and then returns to 0000h to
continue counting.
When the counter becomes 0000h after FFFFh, the CEFLG bit in the PMCiCON2 register becomes 1
(counter overflow) and stays 1 until the next measurement.
Table 22.21 Registers and Setting Values in Input Capture Mode (Simultaneous Count Operation) (2/2)
Register Bit
Function
PMC0
PMC1
PMCiINT
CPINT
Set to 0.
-
REINT
Set to 0.
Set to 0.
DRINT
Set to 0.
Set to 0.
BFULINT
Set to 0.
-
PTHDINT
Set to 0.
Set to 0.
PTDINT
Set to 0.
Set to 0.
TIMINT
Set to 1 when using timer
measure interrupt.
Set to 1 when using timer
measure interrupt.
SDINT
Set to 0.
-
PMC0CPC
CPN0
Set to 000b.
-
CPN1
CPN2
CPEN
Set to 0.
-
PMC0CPD
0 to 7
Set to 00h.
-
PMCiHDPMIN
0 to 10
Set to 0000h.
Set to 0000h.
PMCiHDPMAX
0 to 10
Set to 0000h.
Set to 0000h.
PMCiD0PMIN
0 to 7
Set to 00h.
Set to 00h.
PMCiD0PMAX
0 to 7
Set to 00h.
Set to 00h.
PMCiD1PMIN
0 to 7
Set to 00h.
Set to 00h.
PMCiD1PMAX
0 to 7
Set to 00h.
Set to 00h.
PMCiTIM
0 to 15
Measured value of pulse
period or width can be read.
Measured value of pulse
period or width can be read.
PMC0DAT0 to
PMC0DAT5
0 to 7
Not used.
Not used.
PMC0RBIT
0 to 5
Not used.
Not used.
i = 0, 1
-: Unimplemented bits in PMC1
Note:
1.
This table does not describe a procedure.
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...