Datasheet
V850ES/JG3-H, V850ES/JH3-H CHAPTER 4 PORT FUNCTIONS
R01UH0042EJ0500 Rev.5.00 Page 172 of 1513
Aug 12, 2011
4.5 Cautions
4.5.1 Cautions on setting port pins
(1) In the V850ES/JG3-H and V850ES/JH3-H, the general-purpose port functions share pins with several peripheral
function I/O pins. Switch between the general-purpose port (port mode) and the peripheral function I/O pin
(alternate-function mode) by setting the PMCn register. Note the following cautions with regards to this register
setting sequence.
(a) Cautions on switching from port mode to alternate-function mode
Switch from the port mode to alternate-function mode in the following order.
<1> Set the PFn register
Note 1
: N-ch open-drain setting
<2> Set the PFCn and PFCEn registers: Alternate-function selection
<3> Set the corresponding bit of the PMCn register to 1: Switch to alternate-function mode
<4> Set the INTRn and INTFn registers
Note 2
: External interrupt setting
If the PMCn register is set first, note that unexpected operations may occur at that moment or depending on
the change of the pin states in accordance with the setting of the PFn, PFCn, and PFCEn registers.
A concrete example is shown in [Example] below.
Notes 1. N-ch open-drain output pin only
2. Only when the external interrupt function is selected
Caution Regardless of the port mode/alternate-function mode, the Pn register is read and written as
follows.
• Pn register read: Read the port output latch value (when PMn.PMnm bit = 0), or read the
pin states (PMn.PMnm bit = 1).
• Pn register write: Write to the port output latch
[Example] SCL01 pin setting example
The SCL01 pin is used alternately as the P41/SOF0 pin. Select the valid pin function using the
PMC4, PFC4, and PF4 registers.
PMC41 Bit PFC41 Bit PF41 Bit Valid Pin Function
0 don’t care 1 P41 (in output port mode, N-ch open-drain output)
0 1 SOF0 output (N-ch open-drain output) 1
1 1 SCL01 I/O (N-ch open-drain output)