Datasheet

78K0/Ix2 CHAPTER 4 PORT FUNCTIONS
R01UH0010EJ0500 Rev.5.00 107
Feb 28, 2012
4.2.2 Port 2
78K0/IY2 78K0/IA2 78K0/IB2
16 Pins 20 Pins 30 Pins/32 Pins
P20/ANI0
P20/ANI0/AMP-
Note
P20/ANI0/AMP-
Note
P21/ANI1/PGAIN
Note
P21/ANI1/AMPOUT
Note
/PGAIN
Note
P21/ANI1/AMPOUT
Note
/PGAIN
Note
P22/ANI2/AMP+
Note
P22/ANI2/AMP+
Note
P23/ANI3/CMP2+ P23/ANI3/CMP2+ P23/ANI3/CMP2+
P24/ANI4/CMP0+ P24/ANI4/CMP0+ P24/ANI4/CMP0+
P25/ANI5/CMP1+ P25/ANI5/CMP1+ P25/ANI5/CMP1+
P26/ANI6/CMPCOM
P27/ANI7
Note Products with operational amplifier only
Port 2 is an I/O port with an output latch. Port 2 can be set to the input mode or output mode in 1-bit units using port
mode register 2 (PM2).
This port can also be used for A/D converter analog input, operational amplifier I/O, PGA (Programmable Gain
Amplifier) input, comparator input, and comparator common input.
When using P20/AMP-/ANI0 to P27/ANI7, set the registers according to the pin function to be used (refer to Tables 4-7
to 4-11).
To use P20/AMP-/ANI0 to P27/ANI7 as a digital input or a digital output, it is recommended to select a pin to use
starting with the furthest ANI4 pin from AV
REF. To use P20/AMP-/ANI0 to P27/ANI7 as an analog input, it is recommended
to select a pin to use starting with the closest pin to AVSS.
Table 4-7. Setting Functions of P20/ANI0/AMP-, P22/ANI2/AMP+ Pins
ADPC0
Register
PM2 Register
OPAMP0E
bit
Note
ADS Register
(n = 0, 2)
P20/ANI0/AMP-,
P22/ANI2/AMP+ Pins
Selects ANIn. Setting prohibited Input mode
Does not select ANIn. Digital input
Selects ANIn. Setting prohibited
Digital I/O
selection
Output mode
Does not select ANIn. Digital output
Selects ANIn. Analog input (to be converted into digital signal) 0
Does not select ANIn. Analog input (not to be converted into digital signal)
Selects ANIn.
Analog input (to be converted into digital signal), and
operational amplifier input
Input mode
1
Does not select ANIn. Operational amplifier input
Analog input
selection
Output mode
Setting prohibited
Note 78K0/IA2, 78K0/IB2 only
Remark ADPC0: A/D port configuration register 0
PM2: Port mode register 2
OPAMP0E: Bit 7 of operational amplifier 0 control register (AMP0M)
ADS: Analog input channel specification register