NJU3102
(2) INPUT OUTPUT PORT OPERATION
a) The output operation example
PA0 and PA1 of PORTA output “H”, and PA2 and PA3 of PORTA output “L”.
SRPC
LDI
LDI
TAP
:
:
Y,1
A,%0011
:
:
;
;PHY1 is pointed
;"0011" is stored into Accumulator
;DATA in Accumulator is transmitted to PHY1
b) The input operation example
Accumulator gets the input data from PORTC and the bit of the edge detector is reset
:
:
SRPC
LDI
Y,3
TPA
TAP
:
:
;
;PHY3 is pointed
;The input data from PHY3 is transferred to Accumulator
;The bit(b2) of the edge detector is reset
The signal from PC0 terminal is stored into the bit0(b0) of Accumulator, the signal from PC1 terminal is
stored into the bit1(b1) of Accumulator, the sign of the edge detector from PC1 terminal is stored into the
bit2(b2) of Accumulator, and “zero” is stored into the bit3(b3) of Accumulator.
- 11 -