English
Language : 

W78ERD2 Datasheet, PDF (34/72 Pages) Winbond – 8-BIT MICROCONTROLLER
W78ERD2
P4 (E8H)
BIT
7
6
5
4
3
2
1
0
NAME
-
-
-
-
P43
P42
P41
P40
FUNCTION
Reserve
Reserve
Reserve
Reserve
Port 4 Data bit which outputs to pin P4.3 at mode 0.
Port 4 Data bit which outputs to pin P4.2 at mode 0.
Port 4 Data bit which outputs to pin P4.1at mode 0.
Port 4 Data bit which outputs to pin P4.0 at mode 0.
Here is an example to program the P4.0 as a write strobe signal at the I/O port address 1234H −
1237H and positive polarity, and P4.1 − P4.3 are used as general I/O ports.
MOV P40AH, #12H
MOV P40AL, #34H
; Base I/O address 1234H for P4.0
MOV P4CONA, #00001010B ; P4.0 a write strobe signal and address line A0 and A1 are masked.
MOV P4CONB, #00H
; P4.1 − P4.3 as general I/O port which are the same as PORT1
MOV P2ECON, #10H
; Write the P40SINV = 1 to inverse the P4.0 write strobe polarity
; default is negative.
Then any instruction MOVX @DPTR, A (with DPTR = 1234H − 1237H) will generate the positive
polarity write strobe signal at pin P4.0. And the instruction MOV P4, #XX will output the bit3 to bit1 of
data #XX to pin P4.3 − P4.1.
P4 REGISTER
P4.x
READ
WRITE
P4xCSINV
DATA I/O
RD_CS
MUX 4->1
WR_CS
RD/WR_CS
ADDRESS BUS
EQUAL
REGISTER
P4xAL
P4xAH
Bit Length
Selectable
comparator
REGISTER
P4xCMP0
P4xCMP1
P4xFUN0
P4xFUN1
P4.x INPUT DATA BUS
PIN
P4.x
- 34 -