
AN07-00200-03E
66
MB95F136JBS
P15
P16
P14/PPG0
30
1
29
R19: 3.3k
Ω
LED4:SML-210LT
R20: 3.3k
Ω
LED5:SML-210LT
R21: 3.3k
Ω
LED6:SML-210LT
VCC5
Figure 4-2 LED lighting circuit
P14 端子
P14 端子
(a)LED 消灯
(b)LED 点灯
LED
LED
点灯
消灯
Figure 4-3 LED ON/OFF circuit example (schematic
diagram)
The pin P14 is controlled by the PDR1 register and the DDR register. If using the ports as outputs,
write the value to be output to the bit corresponding to the pins in the PDR1 register (0: Low, 1:
High), and write “1" to the bits corresponding to the pins in the DDR1 register.
Next, regarding switch controls, the switches on the starter kit are connected to the pin P5, which is
the external interrupt input pin, and the general I/O ports on the microcontroller. This section
explains how to detect switch operations (i.e., when the switch is pushed) on the microcontroller
using the pins as external interrupt input pins (INT5).
An overview of the SW2 connection circuit in the starter kit is shown in “Figure 4-4 Connection
configuration between SW2 and microcontroller pins (schematic diagram)”. In the starter kit, SW2 is
connected to the INT5 pin, which is the external interrupt input pin on the microcontroller. If SW2 is
not pressed (i.e., is OFF), the voltage applied to the INT5 pin on the microcontroller is VCC (5V),
which is High. Further, if SW 2 is pressed (i.e., is ON), the voltage applied to the INT5 pin is
grounded, so the INT5 (P5) pin input status is Low.
Consequently, when SW2 is pushed, the
pin P14
LED
OFF
Pin P14
Pin P14
LED
ON
(a) LED OFF
(b) LED ON
Microcontroller
Microcontroller