
Chapter 15. Registers Page 15-9
FX2 I/O ports PORTA-PORTD appear as bit-addressable SFRS. Reading a register or bit returns
the logic level of the port pin that’s two CLKOUT-clocks old. Writing a register bit writes the port
latch. Whether or not the port latch value appears on the I/O pin depends on the state of the pin’s
OE (Output Enable) bit. The I/O pins may also be assigned alternate function values, in which case
the IOx and OEx bit values are overridden on a bit-by-bit basis.
IOD is bit-addressable; see Figure 15-4.
Figure 15-4. Use Bit 2 to set PORTD - Single Instruction
IO port PORTE is also accessed using an SFR, but unlike the PORTA-PORTD SFRs, it is not bit-
addressable; see Figure 15-5.
Figure 15-5. Use OR to Set Bit 3
IOD Port D (bit addressable) SFR 0xB0
b7 b6 b5 b4 b3 b2 b1 b0
D7 D6 D5 D4 D3 D2 D1 D0
R/W R/W R/W R/W R/W R/W R/W R/W
x x x x x x x x
setb IOD.2 ; set bit 2 of IOD SFR
IOE Port E SFR 0xB1
b7 b6 b5 b4 b3 b2 b1 b0
D7 D6 D5 D4 D3 D2 D1 D0
R/W R/W R/W R/W R/W R/W R/W R/W
x x x x x x x x
mov a,IOE
or a,#00001000b ; set bit 3
mov IOE,a
Comentarios a estos manuales