
HARDWARE CONFIGURATION
2-27
I/O PORTS
These registers enable P07 to P00 and P13 to P10 to be used as general-
purpose port inputs after resetting. Write 1 at bits corresponding to each pin.
Used as analog input port. Inhibited for use as general-
purpose port input. 0 is read when PDR is read.
Used as general-purpose input port (DDR register
must be to 0). Inhibited for use as analog input port.
0
1
Register value
Status
Description of functions
The function of each port is described below.
(1) P00 to P07: CMOS-type I/O ports (used as analog input)
P10 to P13: CMOS-type I/O ports (used as analog input)
•
Switching input and output
These ports have a data-direction register (DDR) and port-data register
(PDR) for each bit. Input and output can be set independently for each
bit. The pin with the DDR set to 1 is set to output, and the pin with the DDR
set to 0 is set to input.
•
Operation for output port (DDR = 1)
The value written at the PDR is output to the pin when the DDR is set to 1.
When the PDR is read, usually, the value of the pin is read instead of the
contents of the output latch. However, when the Read Modify Write
instruction is executed, the contents of the output latch are read irrespec-
tive of the DDR setting conditions. Therefore, the bit-processing instruc-
tion can be used even if input and output are mixed with each other. When
data is written to the PDR, the written data is held in the output latch irre-
spective of the DDR setting conditions.
•
Operation for input port (DDR = 0)
When settings the input, the output impedance goes High. Therefore,
when the PDR is read, the value of the pin is read. When 1 is written at the
PCR0 and PCR1 registers, the values of corresponding pins are read as 0
(see Figure 2.11).
•
State when reset
The DDR is initialized to 0 by resetting and the output impedance goes
High at all bits. The PDR is not initialized by resetting. Therefore, set the
PDR value before setting the DDR to output. After resetting, each port is
inhibited for use as an input port, which is fixed to Low (see Figure 2.11).
When using as an input port, each port must be declared for use as an
input port by writing 0 at the corresponding bits of the PCR0 and PCR1
registers.
•
State in stop modes
With the SPL bit of the standby-control register set to 1, in the stop mode,
the output impedance goes High irrespective of the value of the DDR.
Summary of Contents for F2MC-8L Series
Page 121: ...INSTRUCTIONS 4 7 4 5 F2MC 8L FAMILY INSTRUCTION MAP ...
Page 123: ...5 MASK OPTIONS ...
Page 125: ...APPENDIX ...