M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D
EasyAVR
USB
4
EasyAVR4 User
’
s Manual
MikroElektronika
Development
tools
1
18
8
page
PP
UU
SS
HH
BB
PP
UU
SS
HH
BB
UU
TT
TT
OO
NN
SS
WW
IITT
CC
HH
EE
SS
On Fig. 20 the J1 jumper is set
to pull-up, therefore when the
button is not pressed, pull-up
resistor pulls the microcon-
troller’s PA3 pin to +5V.
A button press causes the port
pin to be connected to ground
(J6 is in the lower position).
Thus, only when the button is
pressed the microcontroller
will sense a logical zero; other-
wise the pin state will always
be logical one.
On Fig. 21 the J6 jumper is set
to pull-down, therefore when
the button is not pressed, pull-
down resistor pulls the micro-
controller’s PA3 pin to 0V.
A button press causes the port
pin to be connected to +5V (J6
is in the higher position).
Thus, only when the button is
pressed the microcontroller
will sense a logical one; other-
wise the pin state will always
be logical zero.
A
TMEGA
PB1
PB2
PB3
PB4
PB5
PB6
PB7
RST
VCC
PC7
AVCC
PA7
PA6
PA5
PA4
PA3
PA2
PA0
PA1
GND
XT2
PB0
AREF
AGND
PA3
PORTA
pull-up
0V while pressed
vcc
J1
1
ON
8
7
6
5
4
3
2
SW1
vcc
J6
VCC
A
TMEGA
PB1
PB2
PB3
PB4
PB5
PB6
PB7
RST
VCC
PC7
AVCC
PA7
PA6
PA5
PA4
PA3
PA2
PA0
PA1
GND
XT2
PB0
AREF
AGND
PA3
PORTA
pull-down
5V while pressed
vcc
vcc
J1
1
ON
8
7
6
5
4
3
2
SW1
J6
VCC
Figure 20.
Figure 21.
Button with pull-up resistor
Button with pull-down resistor