English
Language : 

MG82FG5B32 Datasheet, PDF (70/273 Pages) Megawin Technology Co., Ltd – Flexible IAP size by software configured
14.2. I/O Port Register
All I/O port pins on the MG82FG5BXX may be individually and independently configured by software to select its
operating mode. Only Port 3 has four operating modes, as shown in Table 14–2. Two mode registers select the
output type for each port 3 pin.
Table 14–2. Port 3 Configuration Settings
P3M0.y
P3M1.y Port Mode
0
0
Quasi-Bidirectional
0
1
Push-Pull Output
1
0
Input Only (High Impedance Input)
1
1
Open-Drain Output
Where y=0~5 (port pin). The registers P3M0 and P3M1 are listed in each port description.
Other general port pins support two operating modes, as shown in Table 14–3. One mode register selects the
output type for each port pin.
Table 14–3. General Port Configuration Settings
PxM0.y Port Mode
0
Open-Drain Output
1
Push-Pull Output
Where x= 1, 2, 4, 6 (port number), and y=0~7 (port pin). The registers PxM0 are listed in each port description.
14.2.1. Port 1 Register
P1: Port 1 Register
SFR Page
= 0~F
SFR Address = 0x90
7
6
P1.7
P1.6
R/W
R/W
5
P1.5
R/W
4
P1.4
R/W
RESET = 1111-1111
3
2
P1.3
P1.2
R/W
R/W
1
P1.1
R/W
0
P1.0
R/W
Bit 7~0: P1.7~P1.0 could be only set/cleared by CPU.
P1M0: Port 1 Mode Register 0
SFR Page
= 0~F
SFR Address = 0x91
7
6
5
P1M0.7 P1M0.6 P1M0.5
R/W
R/W
R/W
RESET = 0000-0000
4
3
2
P1M0.4 P1M0.3 P1M0.2
R/W
R/W
R/W
1
P1M0.1
R/W
0
P1M0.0
R/W
0: Port pin output mode is configured to open-drain.
1: Port pin output mode is configured to push-pull.
P1AIO: Port 1 Analog Input Only
SFR Page
= 0~F
SFR Address = 0x92
7
6
5
P17AIO P16AIO P15AIO
R/W
R/W
R/W
RESET = 0000-0000
4
3
2
P14AIO P13AIO P12AIO
R/W
R/W
R/W
1
P11AIO
R/W
0
P10AIO
R/W
0: Port pin has digital and analog input capability.
1: Port pin only has analog input only for ADC input application. The corresponding Port PIN Register bit will
always read as “0” when this bit is set.
70
MG82FG5BXX Data Sheet
MEGAWIN