CHAPTER 14 PORT FUNCTION
User’s Manual U13850EJ6V0UD
484
(1) Function of P2 pins
Port 2 is an 8-bit I/O port for which I/O settings can be controlled in 1-bit units. I/O settings are controlled via the
port 2 mode register (PM2).
In output mode, the values set to each bit are output to the port 2 register (P2). The port 2 function register (PF2)
can be used to specify whether P20, P21, P22, P24 and P25 are normal outputs or N-ch open-drain outputs.
When using this port in input mode, the pin statuses can be read by reading the P2 register. Also, the P2
register (output latch) values can be read by reading the P2 register while in output mode.
A pull-up resistor can be connected in 1-bit units when specified via pull-up resistor option register 2 (PU2).
When using the alternate function as TI2 and TI3 pins, noise elimination is provided by a digital noise eliminator
(same as digital noise eliminator for port 0).
Clear the P2 and PM2 registers to 0 when using alternate-function pins as outputs. The ORed result of the port
output and the alternate-function pin is output from the pins.
When a reset is input, the settings are initialized to input mode.
(2) Control registers
(a) Port 2 mode register (PM2)
PM2 can be read/written in 8-bit or 1-bit units.
After reset:
FFH
R/W
Address: FFFFF024H
7
6
5
4
3
2
1
0
PM2
PM27
PM26
PM25
PM24
PM23
PM22
PM21
PM20
PM2n
Control of I/O mode (n = 0 to 7)
0
Output mode
1
Input mode
Содержание V850/SB1
Страница 2: ...User s Manual U13850EJ6V0UD 2 MEMO ...