Description (Port 2) - Panasonic MN103S User Manual

Panaxseries
Hide thumbs Also See for MN103S:
Table of Contents

Advertisement

7.3.2

Description (Port 2)

General Port Setup
Each bit can be set individually as either an input or output by the port 2 I/O control register (P2DIR). The control
flag of the P2DIR register is set to "1" for output mode, and to "0" for input mode.
To read input data of a pin, set the control flag of the P2DIR register to "0" and read the value of the port 2 input
register (P2IN).
To output data to a pin, set the control flag of the P2DIR register to "1" and write data to the port 2 output register
(P2OUT).
Each bit can be set individually if pull-up resistor is added or not, by the port 2 pull-up control register (P2PLU).
Set the control flag of the P2PLU register to "1" to add pull-up resistor.
Special Function Pin Setup
P20 to P21 are used as serial 2 I/O pins as well. P20 is an I/O pin for the serial 2 clock. When the SC2SBTS flag
of the serial interface 2 mode register 1 (SC2CTR1) and the P20M flag of the port 2 output mode register (P2MD)
are set to "1", P20 becomes an I/O pin for serial clock. P21 is an input pin for the serial 2 and UART 2 reception
data. When the SC2SBIS flag of the SC2CTR1 register is set to "1" , P21 becomes an input pin for the serial data.
P22 to P24 are used as serial 1 I/O pins as well. P22 is an output pin for the serial 1 and UART 1 transmission
data. When the P22M flag of the P2MD register is set to "1", P22 becomes an output pin for the serial data. When
the P22M flag of the P2MD register is set to "1", P23 becomes an I/O pin for serial clock. P24 is an input pin for
the serial 1 and UART 1 reception data.
P25 to P27 are used as serial 0 I/O pins as well. P25 is an output pin for the serial 0 and UART 0 transmission
data. When the 25M flag of the P2MD register is set to "1", P25 becomes an output pin for the serial data. When
the P26 flag of the P2MD register is set to "1", P26 becomes an I/O pin for serial clock. P27 is an input pin for the
serial 0 and UART 0 reception data.
Chapter 7
I/O Port
Ports
VII - 33

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn103sa7dMn103sa7g

Table of Contents