NuMicro™ Mini51 Technical Reference ManualFeb 9, 2012 Page 142 of 342 Revision V1.03NUMICRO™ MINI51 TECHNICAL REFERENCE MANUAL5.8 General Purpose I/O5.8.1 OverviewThere are 30 General Purpose I/O pins shared with special feature functions in this MCU. The 30pins are arranged in 6 ports named P0, P1, P2, P3, P4 and P5. Each of the 30 pins is independentand has the corresponding register bits to control the pin mode function and data.The I/O type of each I/O pin can be independently software configured as input, output, open-drain, or Quasi-bidirectional mode. After reset, the I/O type of all pins stay in input mode and portdata register Px_DOUT[n] resets to “1”. For Quasi-bidirectional mode, each I/O pin is equippedwith a very weak individual pull-up resistor about 110K ~ 300K for VDD from 5.0V to 2.5V.5.8.2 Features Four I/O modes: Quasi bi-direction Push-Pull output Open-Drain output Input-only with high impendence TTL/Schmitt trigger input selectable I/O pin can be configured as interrupt source with edge/level setting High driver and high sink IO mode support5.8.3 Functional Description5.8.3.1 Input ModeWhen Px_PMD (PMDn[1:0]) is set to 00, the Px[n] pin is in Input mode and the I/O pin is in tri-state(high impedance) without output drive capability. The Px_PIN value reflects the status of thecorresponding port pins.5.8.3.2 Output ModeWhen Px_PMD (PMDn[1:0]) is set to 01, the Px[n] pin is in Output mode and the I/O pin supportsdigital output function with source/sink current capability. The bit value in the corresponding bit [n]of Px_DOUT is driven on the pin.