Datasheet
CHAPTER 4 PORT FUNCTIONS
User’s Manual U18698EJ1V0UD
81
4.2.2 Port 2
Port 2 is a 6-bit 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 10-bit successive approximation type A/D converter analog input (
μ
PD78F041x only)
and segment output.
To use P20/SEG21/ANI0
Note
to P25/SEG16/ANI5
Note
as digital input pins, set them to port function (other than
segment output) by using the port function register 2 (PF2), to digital I/O by using ADPC0, and to input mode by using
PM2. Use these pins starting from the lower bit.
To use P20/SEG21/ANI0
Note
to P25/SEG16/ANI5
Note
as digital output pins, set them to port function (other than
segment output) by using the port function register 2 (PF2), to digital I/O by using ADPC0, and to output mode by
using PM2. Use these pins starting from the lower bit.
Reset signal generation sets port 1 to input mode.
Figure 4-4 shows block diagrams of port 2.
Table 4-4. Setting Functions of P20/SEG21/ANI0
Note
to P25/SEG16/ANI5
Note
Pins
PF2 ADPC0
Note
PM2 ADS
P20/SEG21/ANI0
Note
to
P25/SEG16/ANI5
Note
Does not select
ANI.
Analog input (not to be converted)
Input mode
Selects ANI.
Analog input (to be converted by successive
approximation type A/D converter)
Analog input
selection
Output mode
−
Setting prohibited
Input mode
−
Digital input
Digital/Analog
selection
Digital I/O
selection
Output mode
−
Digital output
SEG output
selection
− − −
Segment output
Note
μ
PD78F041x only.