Datasheet

V850ES/JG3 CHAPTRER 4 PORT FUNCTIONS
R01UH0015EJ0300 Rev.3.00 Page 144 of 870
Sep 30, 2010
4.6 Cautions
4.6.1 Cautions on setting port pins
(1) In the V850ES/JG3, the general-purpose port function and several peripheral function I/O pin share a pin. To
switch between the general-purpose port (port mode) and the peripheral function I/O pin (alternate-function mode),
set by the PMCn register. In regards to this register setting sequence, note with caution the following.
(a) Cautions on switching from port mode to alternate-function mode
To switch from the port mode to alternate-function mode in the following order.
<1> Set the PFn register
Note
: 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
If the PMCn register is set first, note with caution that, at that moment or depending on the change of the pin
states in accordance with the setting of the PFn, PFCn, and PFCEn registers, unexpected operations may
occur.
A concrete example is shown as Example below.
Note No-ch open-drain output pin only
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 with the P41/SOB0 pin. Select the valid pin functions with the
PMC4, PFC4, and PF4 registers.
PMC41 Bit PFC41 Bit PF41 Bit Valid Pin Functions
0 don’t care 1 P41 (in output port mode, N-ch open-drain output)
0 1 SOB0 output (N-ch open-drain output) 1
1 1 SCL01 I/O (N-ch open-drain output)