R01UH0136EJ0210 Rev.2.10
Page 430 of 800
Jul 31, 2012
M16C/64A Group
22. Remote Control Signal Receiver
22.3.2.4
Compare Function (PMC0)
Values for registers PMC0CPD and PMC0DAT0 are compared. As a result, it can be detected that
the first 1 to 8 bits of the remote control signal are the specific values.
When using the compare function, set the following:
•
Set the CPEN bit in the PMC0CPC register to 1 (compare enabled).
•
Select bits to be compared by setting bits CPN2 to CPN0 in the PMC0CPC register (when the
setting value is n, bits n to 0 are compared. n: 0 to 7).
•
Set the compare data in the PMC0CPD register.
When storing received data, if the compared results match, the CPFLG bit in the PMC0STS register
becomes 1 (compare match).
Figure 22.8
Receive Buffer and Compare Function
0000 0000b
0000 0000b
1111 0110b
0
4
Data 0
Data 0
Data 1
Data 1
Data 1
Data 0
0000 0010b 0000 0110b 0000 0110b
PMC0 internal input signal
ENFLG bit in the
PMC0CON2 register
PMC0RBIT register
PMC0DAT0 register
Data 0 is
stored in
bit 0
Data 1 is
stored in
bit 1
Data 1 is
stored in
bit 2
Data 0 is
stored in
bit 3
Data 1 is
stored in
bit 7
0000 0001b
0000 0000b
Data 1 is
stored in
bit 8
PMC0DAT1 register
XXXX X110b
PMC0CPD register
CPFLG bit in the
PMC0STS register
Compare match
The above diagram shows an instance in which the following conditions are met:
y
The CPEN bit in the PMC0CPC register is 1 (compare enabled)
y
Bits CPN2 to CPN0 in the PMC0CPC register equal 2 (bits 2 to 0 are compared)
1
2
3
8
9
Содержание M16C/60 Series
Страница 853: ...M16C 64A Group R01UH0136EJ0210...