
PP
UU
SS
HH
BB
UU
TT
TT
OO
NN
SS
Referring to Figure 24, jumper J2 is set to
pull-up, so that pull-up resistor pulls the
microcontroller pin RB4 to +5V.
By pressing the button, the RB4 pin is
connected to ground via J17.
Accordingly, only when the button is
pressed the microcontroller senses a
logic zero (0). Otherwise, the pin state
will always be a logic one (1).
Referring to Figure 25, switch J2 is set to
pull-down, so that pull-down resistor pulls
the microcontroller pin RB4 to 0V.
By pressing the button, the RB4 pin is
connected to +5V via J17.
Accordingly, only when the button is
pressed the microcontroller senses a
logic one (1). Otherwise, the pin state will
always be a logic zero (0).
2
21
1
Figure 24
Figure 25
Button with pull-up resistor
Button with pull-down resistor