
CHAPTER 4 PORT FUNCTIONS
User’s Manual U17716EJ2V0UD
67
4.3.1
Port 0
Port 0 can be set to the input or output mode in 1-bit units.
Port 0 has an alternate function as the following pins.
Table 4-4. Alternate-Function Pins of Port 0
Pin Name
Pin No.
Alternate-Function Pin
I/O
Pull-Up
Note 1
P00
Note 2
17
INTP0/TOQH0OFF
Note 3
Input
P01
Note 2
16
INTP1/TOQ1OFF
Note 3
Input
P02
Note 2
15
INTP2/TOP2OFF
Note 3
Input
P03
Note 2
14
INTP3/TOP3OFF
Note 3
Input
P04
Note 2
13
INTP4/ADTRG0
Note 3
Input
P05
Note 2
12
INTP5/ADTRG1
Note 3
Input
P06
Note 2
11
INTP6
Input
Provided
Notes 1. Software pull-up function
2. These pins operate as Schmitt trigger inputs when they are read in the port mode.
3. The TOQH0OFF, TOQ1OFF, TOP2OFF, TOP3OFF, ADTRG0, and ADTRG1 signals are input to the
high-impedance output controller (see CHAPTER 9
MOTOR CONTROL FUNCTION) and A/D
converters 0 and 1 (see CHAPTER 11 A/D CONVERTERS 0 AND 1) after noise is eliminated by a
port (analog delay). In addition, a signal whose edge was detected is input to the interrupt controller
(INTC) as INTPn (n = 0 to 5). Edge detection is performed by the high-impedance output controller and
A/D converters 0 and 1.
Cautions 1. To control the high-impedance output of a timer for motor control, be sure to set the
PMC0.PMC0n bit to 1 and then specify the edge to be detected and enable the operation of the
high-impedance output controller (n = 1 to 3), because the output of the motor control timer
may go into a high-impedance state if a wrong valid edge is detected.
2. To input an A/D trigger to A/D converter 0 or 1, be sure to set the PMC0.PMC0n bit to 1 and
then specify the edge to be detected and enable the operation of A/D converter 0 or 1 because
the trigger may be input if a wrong valid edge is detected (n = 4, 5).
3. To switch to external interrupt input (INTPn) from the port mode (by changing the
PMC0.PMC0n bit from 0 to 1), an external interrupt may be input if a wrong valid edge is
detected.
Therefore, be sure to disable edge detection (INTF0.INTF0n bit = 0 and
INTR0.INTR0n bit = 0), select external interrupt input (INTPn), and then specify the valid edge
(n = 0 to 6).
When switching to the port mode from external interrupt input (INTPn) (PMC0n bit = 1
→ 0), an
edge may be detected. Be sure to disable edge detection (INTF0n bit = 0, INTR0n bit = 0), and
then select the port mode.