Programmable I/O Ports Usage; Overview Of The Programmable I/O Ports Usage - Renesas M16C Series User Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30245 Group

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:
www.DataSheet4U.com
(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
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
is used as the input-only port, it also serves as NMI. P8
5
be set to this port. As NMI cannot be disabled, an NMI interrupt occurs if a falling edge is input to P8
Use P8
(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
Pull-up can be set for P0 to P3, P4
for P0 to P3, P4
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.
Rev.2.00 Oct 16, 2006
REJ09B0340-0200
_______
for reading the level input at this time only.
5
to P4
, P5
to P5
0
3
0
page 284 of 354
_______
_______
_____
________ ______
_______
5
_______
/X
is set or a port is used as A/D input.
CIN
COUT
to P4
, P5
to P5
in only single-chip mode. Pull-up cannot be set
0
3
0
3
in memory expansion and microprocessor modes. The contents
3
2. Programmable I/O Ports
and P7
0
________ _______
has no direction register. Pull-up cannot
are N
1
_______
__________
.
5

Advertisement

Table of Contents
loading

Table of Contents