English
Language : 

M306V5ME-XXXSP Datasheet, PDF (221/262 Pages) Mitsubishi Electric Semiconductor – SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER and ON-SCREEN DISPLAY CONTROLLER
MITSUBISHI MICROCOMPUTERS
M306V5ME-XXXSP
M306V5EESP
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER with CLOSED CAPTION DECODER
and ON-SCREEN DISPLAY CONTROLLER
2.17 Programmable I/O Ports
There are 46 programmable I/O ports: P00–P07, P20–P27, P30–P37, P40–P43, P50, P52, P53, P62, P63,
P67, P70–P72, P74, P76, P82, P90, P93, P94, P100 and P101. Each port can be set independently for input
or output using the direction register. A pull-up resistance for each block of 4 ports can be set.
Figures 2.17.1 to 2.17.3 show the programmable I/O ports.
Each pin functions as a programmable I/O port and as the I/O for the built-in peripheral devices.
To use the pins as the inputs for the built-in peripheral devices, set the direction register of each pin to input
mode. When the pins are used as the outputs for the built-in peripheral devices (other than the D-A con-
verter), they function as outputs regardless of the contents of the direction registers. When pins are to be
used as the outputs for the D-A converter, do not set the direction registers to output mode. See the
descriptions of the respective functions for how to set up the built-in peripheral devices.
2.17.1 Direction Registers
Figures 2.17.5 to 2.17.12 show the direction registers.
These registers are used to choose the direction of the programmable I/O ports. Each bit in these regis-
ters corresponds one for one to each I/O pin.
(1) Effect of the protection register
Data written to the direction register of P9 is affected by the protection register. The direction register
of P9 cannot be easily written.
2.17.2 Port Registers
Figures 2.17.13 to 2.17.20 show the port registers.
These registers are used to write and read data for input and output to and from an external device. A
port register consists of a port latch to hold output data and a circuit to read the status of a pin. Each bit
in port registers corresponds one for one to each I/O pin.
(1) Reading a port register
With the direction register set to output, reading a port register takes out the content of the port regis-
ter, not the content of the pin. With the direction register set to input, reading the port register takes out
the content of the pin.
(2) Writing to a port register
With the direction register set to output, the level of the written values from each relevant pin is output
by writing to a port register. Writing to the port register, with the direction register set to input, inputs a
value to the port register, but nothing is output to the relevant pins. The output level remains floating.
Rev. 1.0
221