English
Language : 

W78IRD2 Datasheet, PDF (31/76 Pages) Winbond – 8-BIT MICROCONTROLLER
W78IRD2
For example, the following program sets up P4.0 as a write-strobe signal for I/O port addresses 1234H
− 1237H with positive polarity, while 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 is a write-strobe signal; address lines A0 and A1 are masked.
MOV P4CONB, #00H
; P4.1 − P4.3 are general I/O ports
MOV P2ECON, #10H
; Set P40SINV to 1 to invert the P4.0 write-strobe to positive polarity.
Then, any instruction MOVX @DPTR, A (where DPTR is in 1234H − 1237H) generates a positive-
polarity, write-strobe signal on pin P4.0, while the instruction MOV P4, #XX puts bits 3 – 1 of data #XX
on pins P4.3 − P4.1.
- 31 -
Publication Release Date: October 2, 2006
Revision A7