NEC 78K0 Series User Manual page 113

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0 Series:
Table of Contents

Advertisement

5.2.3 Port 2
Port 2 is an 8-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 A/D converter analog input.
To use P20/ANI0 to P27/ANI7 as digital input pins, set them in the digital I/O mode by using the A/D port
configuration register (ADPC) and in the input mode by using PM2. Use these pins starting from the lower bit.
To use P20/ANI0 to P27/ANI7 as digital output pins, set them in the digital I/O mode by using ADPC and in the
output mode by using PM2.
ADPC
Digital I/O selection
Analog input selection
All P20/ANI0 to P27/ANI7 are set in the analog input mode when the reset signal is generated.
Figure 5-13 shows a block diagram of port 2.
RD
WR
PORT
WR
PM
P2:
Port register 2
PM2:
Port mode register 2
RD:
Read signal
WR××: Write signal
CHAPTER 5 PORT FUNCTIONS
Table 5-4. Setting Functions of P20/ANI0 to P27/ANI7 Pins
PM2
Input mode
Selects ANI.
Does not select ANI.
Output mode
Selects ANI.
Does not select ANI.
Input mode
Selects ANI.
Does not select ANI.
Output mode
Selects ANI.
Does not select ANI.
Figure 5-13. Block Diagram of P20 to P27
P2
Output latch
(P20 to P27)
PM2
PM20 to PM27
A/D converter
Preliminary User's Manual U17260EJ3V1UD
ADS
P20/ANI0 to P27/ANI7 Pin
Setting prohibited
Digital input
Setting prohibited
Digital output
Analog input (to be converted)
Analog input (not to be converted)
Setting prohibited
P20/ANI0 to
P27/ANI7
113

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents