
R01UH0336EJ0102 Rev.1.02
Page 43 of 1538
Jul 17, 2014
V850E2/PG4-L
Section 2 Port Functions
2.2.3
Pin Data Input/Output
The registers used for data input and output are described below.
The sources of the data for output and of data read via the PPRn register will
differ with the pin mode.
Output data
In port mode (PMCn.PMCn_m = 0), the data of Pn.Pn_m is output to pin
Pn_m.
With a direct I/O control alternative function (PIPCn.PIPCn_m = 1), output is
controlled by the alternative function.
Input data
A read operation of the PPRn register returns either the value of the Pn_m pin,
the associated bit of the port register Pn.Pn_m, or the data output by an
alternative function. The source of the data read via PPRn depends on the pin
mode and the setting of several control bits. The table below summarizes the
different PPRn read modes.
Caution
When the PCLK signal is at or above 64 MHz, secure at least 3 cycles of the
PCLK before reading a PPR immediately after register settings are made and
the input buffers for registers connected to the ports are enabled. Also, read
the registers twice and discard the value read the first time.
Note 1.
If PBDCn_m = 1, the Pn_m pin level is read via PPRn_m.
Note 2.
When the PPRn_m bit is read while PMCn_m = 1 for the internal signal output
of an alternative function, the level read is not that on the Pn_m pin but the
level of the internal signal for the alternative function.
The control registers in the table above have following effects:
• PBDCn.PBDCn_m
This bit forces to read the Pn_m pin level via PPRn_m, thus enabling a
mode, where the level of pin Pn_m can also be read back if the port is
operated in output mode.
Table 2-6
PPRn_m Read Values
PMCn_m
PMn_m
PIBCn_m
PIPCn_m
Mode
PPRn_m Read Value
0
1
0
×
Port input, input buffer disabled
Pn.Pn_m register
1
Port input, input buffer enabled
Pn_m pin
0
×
Port output
Pn.Pn_m register
*
1
1
1
×
0
Input for alternative function
under software I/O control
Pn_m pin
0
Output for alternative function
under software I/O control
Internal signal output for
alternative function
*
2
×
1
Input and output for alternative
function under direct I/O control
If alternative functions sets
port in
•
input: PPRn_m = Pn_m
pin
•
output: PPRn_m =
alternative function
output
*
1,2