English
Language : 

W78E516DDG Datasheet, PDF (35/90 Pages) Nuvotem Talema – 8-BIT MICROCONTROLLER
W78E516D/W78E058D Data Sheet
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
MOV P4CONA,#00001010B
MOV P4CONB,#00H
MOV P2ECON,#10H
;Define the base I/O address 1234H for P4.0 as an special function
;Define the P4.0 as a write strobe signal pin and the comparator
;P4.1~P4.3 as general I/O port which are the same as PORT1
;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
P4xCSINV
DATA I/O
RD_CS
READ
WRITE
WR_CS
RD/WR_CS
MUX 4->1
PIN
P4.x
ADDRESS BUS
REGISTER
P4xAL
P4xAH
comparator
EQUAL
Bit Length
Selectable
comparator
REGISTER
P4xCMP0
P4xCMP1
P4xFUN0
P4xFUN1
P4.x INPUT DATA BUS
The Port 4 Structure Diagram
ACCUMULATOR
Bit: 7
6
5
4
3
2
1
0
- 35 -
Publication Release Date: Feb 15, 2011
Revision A09