English
Language : 

W79E217A Datasheet, PDF (186/207 Pages) Winbond – 8-bit Microcontroller
Preliminary W79E217A Data Sheet
P4 REGISTER
P4.x
P4xCSINV
READ
WRITE
DATA I/O
RD_CS
MUX 4->1
WR_CS
RD/WR_CS
PIN
P4.x
ADDRESS BUS
EQUAL
P4xM0
P4xM1
REGISTER
P4xAL
P4xAH
Bit Length
Selectable
comparator
P4.x INPUT DATA BUS
REGISTER
P4xC0
P4xC1
Figure 22-1: Port 4 Structure Diagram
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
; Define the base I/O address 1234H for P4.0 as an special function
MOV P4CONA, #00001010B ; Define the P4.0 as a write strobe signal pin and the compared
address is [A15:A2]
MOV P4CONB, #00H
; P4.1~P4.3 as general I/O port which are the same as PORT1
MOV P4CSIN, #10H
; Write the P40CSINV =1 to inverse the P4.0 write strobe polarity
Then any instruction writes data to address from 1234H to 1237H, for example MOVX @DPTR,A
(with DPTR=1234H~1237H), will generate the positive polarity write strobe signal at pin P4.0. And the
instruction of “MOV P4, #XX” will output the bit3 to bit1 of data #XX to pin P4.3~ P4.1.
- 186 -
Publication Release Date: December 14, 2007
Revision A3.0