English
Language : 

W78LE365_07 Datasheet, PDF (10/42 Pages) Winbond – 8-BIT MICROCONTROLLER
W78LE365/W78L365A
5.6 Port 4
Port 4, address D8H, is a 8-bit multipurpose programmable I/O port. Each bit can be configured
individually by software. The Port 4 has four different operation modes.
Mode 0: P4.0−P4.3 is a bi-directional I/O port which is same as port 1. P4.2 and P4.3 also serve as
external interrupt PSENand INT2 if enabled.
Mode 1: P4.0−P4.3 are read strobe signals that are synchronized with RD signal at specified
addresses. These signals can be used as chip-select signals for external peripherals.
Mode 2: P4.0−P4.3 are write strobe signals that are synchronized with WR signal at specified
addresses. These signals can be used as chip-select signals for external peripherals.
Mode 3: P4.0−P4.3 are read/write strobe signals that are synchronized with RD or WR signal at
specified addresses. These signals can be used as chip-select signals for external
peripherals.
When Port 4 is configured with the feature of chip-select signals, the chip-select signal address range
depends on the contents of the SFR P4xAH, P4xAL, P4CONA and P4CONB. The registers P4xAH
and P4xAL contain the 16-bit base address of P4.x. The registers P4CONA and P4CONB contain the
control bits to configure the Port 4 operation mode.
The high nibble of port4(P4.4 to P4.7) can be selected to serve to the direct LED display drive outputs
by setting the HDx bit is set, the corresponding pin p4.x can sink about 20 mA current for driving LED
display directly.
5.6.1 Port Options Register
Bit:
7
6
5
4
3
2
1
0
-
-
-
HD47 HD46 HD45 HD44 P0UP
Mnemonic: POR
Address: 86H
HD47-44: Enable pins P4.4 to P4.7 individually with high drive outputs.
P0UP: Enable Port 0 weak up. The pins of Port 0 can be configured with either the open drain or
standart port with internal pull-up. By the default, Port 0 is an open drain bi-directional I/O port. When
the P0UP bit in the POR register is set, the pins of port 0 will perform a bi-directional I/O port with
internal pull-up that is structurally the same Port2.
5.6.2 INT2 / INT3
Two additional external interrupts, INT2 and INT3 , whose functions are similar to those of external
interrupt 0 and 1 in the standard 80C52. The functions/status of these interrupts are
determined/shown by the bits in the XICON (External Interrupt Control) register. The XICON register is
bit-addressable but is not a standard register in the standard 80C52. Its address is at 0C0H. To
set/clear bits in the XICON register, one can use the "SETB ( CLR ) bit" instruction. For example,
"SETB 0C2H" sets the EX2 bit of XICON.
- 10 -