Datasheet

CHAPTER 12 10-BIT SUCCESSIVE APPROXIMATION TYPE A/D CONVERTER (
μ
PD78F041x only)
User’s Manual U18698EJ1V0UD
301
(6) Port mode register 2 (PM2)
When using the ANI0/P20 to ANI5/P25 pins for analog input port, set PM20 to PM25 to 1. The output latches of
P20 to P25 at this time may be 0 or 1.
If PM20 to PM25 are set to 0, they cannot be used as analog input port pins.
PM2 can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets this register to FFH.
Figure 12-10. Format of Port Mode Register 2 (PM2)
Address: FF8FH After reset: 08H R/W
Symbol 7 6 5 4 3 2 1 0
PM2 1 1 PM25 PM24 PM23 PM22 PM21 PM20
PM2n P2n pin I/O mode selection (n = 0 to 5)
0 Output mode (output buffer on)
1 Input mode (output buffer off)
ANI0/P20 to ANI5/P25 pins are as shown below depending on the settings of PF2, ADPC0, PM2, and ADS.
Table 12-3. Setting Functions of P20/ANI0 to P25/ANI5 Pins
PF2 ADPC0 PM2 ADS P20/SEG21/ANI0 to P25/SEG16/ANI5 Pins
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