Rev.2.00 Oct 16, 2006 page 284 of 354
REJ09B0340-0200
M30245 Group
2. Programmable I/O Ports
2.17 Programmable I/O Ports Usage
2.17.1 Overview of the programmable I/O ports usage
Eighty-one programmable I/O ports and one input-only port are available. I/O pins also serve as I/O pins
for built-in peripheral functions.
Each port has a direction register that defines the I/O direction and also has a port register for I/O data. In
addition, each port has a pull-up control register that defines pull-up in terms of 4 bits. The input-only port
has neither direction register nor pull-up control bit.
The following is an overview of the programmable I/O ports usage:
(1) 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. The output level conforms to CMOS output. Port P7
0
and P7
1
are N
channel open drain. 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.
In memory expansion and microprocessor mode, the contents of corresponding port and direction
_______
_______
_____
________ ______
________ _______
_______
__________
registers of pins A0 to A19, D0 to D15, CS0 to CS3, RD, WRL/WR, WRH/BHE, ALE, RDY, HOLD,
_________
HLDA and BCLK cannot be modified.
(2) 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.
(3) Input-only port
_______
P8
5
is used as the input-only port, it also serves as NMI. P8
5
has no direction register. Pull-up cannot
_______
_______
be set to this port. As NMI cannot be disabled, an NMI interrupt occurs if a falling edge is input to P8
5
.
Use P8
5
for reading the level input at this time only.
(4) Setting pull-up
The pull-up control bit allows setting of the pull-up, in terms of 4 bits, either in use or not in use. For the
four bits chosen, pull-up is effective only in the ports whose direction register is set to input. Pull-up is
not effective in ports whose direction register is set to output.
Do not set pull-up of corresponding pin when X
CIN
/X
COUT
is set or a port is used as A/D input.
Pull-up can be set for P0 to P3, P4
0
to P4
3
, P5
0
to P5
3
in only single-chip mode. Pull-up cannot be set
for P0 to P3, P4
0
to P4
3
, P5
0
to P5
3
in memory expansion and microprocessor modes. The contents
of register can be changed, but the pull-up resistance is not connected.
(5) Setting drive capacity
A normal drive and N-channel high drive for the N-channel transistor drive capacity of port P7 can be
selected. Port P7 can be configured to drive an LED by increasing the drive strength of the corre-
sponding N-channel transistor bits.
Содержание M16C FAMILY
Страница 12: ...Chapter 1 Hardware...
Страница 13: ...See M30245 group datasheet...
Страница 14: ...Chapter 2 Peripheral Functions Usage...
Страница 303: ...THIS PAGE IS BLANK FOR REASONS OF LAYOUT...
Страница 304: ...Chapter 3 Examples of Peripheral Functions Applications...
Страница 340: ...Chapter 4 External Buses...
Страница 361: ...THIS PAGE IS BLANK FOR REASONS OF LAYOUT...
Страница 362: ...Chapter 5 Standard Characteristics...
Страница 369: ...1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan M30245 Group REJ09B0340 0200 User s Manual...