143CHAPTER 6 PORT FUNCTIONSP-chWRPMWRPORTRDWR PUOVDDSelectorPUO5Output Latch(P50 to P57)PM50-PM57Internal busP50/A8P57/A156.2.7 Port 5Port 5 is an 8-bit input/output port with output latch. P50 to P57 pins can specify the input mode/output mode in1-bit units with the port mode register 5 (PM5). When P50 to P57 pins are used as input ports, an on-chip pull-upresistor can be used to them in 8-bit units with a pull-up resistor option register L (PUOL).Port 5 can drive LEDs directly.Alternate function includes address bus function in external memory expansion mode.RESET input sets port 5 to input mode.Figure 6-12 shows a block diagram of port 5.Figure 6-12. P50 to P57 Block DiagramPUO : Pull-up resistor option registerPM : Port mode registerRD : Port 5 read signalWR : Port 5 write signal