Professional Documents
Culture Documents
MikroElektronika
Development tools - Books - Compilers
2 in 1
USB 2.0
IN-CIRCUIT
PROGRAMMER
ATMEL
AVR
DEVELOPMENT
BOARD
EasyAVR4
Users Manual
MikroElektronika
Development
tools
Second edition
December 2006
No part of this manual, including the product and software described in it, may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language
in any form or by any means, except documentation kept buy the purchaser for backup purposes, without the express written permission of MikroElektronika company.
Product warranty or service will not be extended if the product is repaired, modified or
altered, unless such repair, modification or alteration is authorized in writing by
MikroElektronika.
MIKROELEKTRONIKA PROVIDE THIS MANUAL AS IS WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
WARRANTIES OR CONDITIONS OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PUROSE.
IN NO EVENT SHALL MIKROELEKTRONIKA, ITS DIRECTORS, OFFICERS, EMPLOYEES OR DISTRIBUTORS BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES(INCLUDING DAMAGES FOR LOSS OF PROFITS, LOSS
OF BUSINESS, LOSS OF USE OR DATA, INTERRUPTION OF BUSINESS AND THE
LIKE) EVEN IF MIKROELEKTRONIKA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES ARISING FROM ANY DEFECT OR ERROR IN THIS MANUAL OR
PRODUCT.
SPECIFICATION AND INFORMATION CONTAINED IN THIS MANUAL ARE FURNISHED
FOR INTERNATIONAL USE ONLY, AND ARE SUBJECT TO CHANGE AT ANY TIME WITHOUT NOTICE, AND SHOULD BE CONSTRUED AS A COMMITMENT BY
MIKROELEKTRONIKA
MikroElektronika assumes no responsibility or liability for any errors or inaccuracies that
may appear in this manual, including the product and software described in it.
Product and corporate names appearing in this manual may or may not be registered trademarks or copyrights of their respective companies, and are used only for identification or
explanation and to the owners benefit, without intent to infringe.
page
USB
EasyAVR
CONTENTS
MikroElektronika
Development
tools
CONTENTS
CONNECTING THE SYSTEM
page 4
INTRODUCTION
page 5
page 5
Switches
page 6
Jumpers
page 7
MCU sockets
page 8
Power Supply
page 10
page 11
Oscillator
page 12
LEDs
page 14
Pushbutton switches
page 16
7-segment displays
page 19
Graphic LCD
page 20
page 21
page 22
RS-232 Communication
page 24
page 26
page 27
page 29
JTAG connector
page 31
page 32
page
USB
EasyAVR
MikroElektronika
Development
tools
page
USB
EasyAVR
ATMEL
AVR
DEVELOPMENT
BOARD
INTRODUCTION
The EasyAVR4 development system is a full-featured development board for Atmel AVR
microcontrollers. It has been designed to allow students and engineers to easily exercise and
explore the capabilities of AVR microcontrollers. It allows AVR microcontrollers to be interfaced with external circuits and a broad range of peripheral devices, allowing a user to concentrate on software development.
Figure 1 illustrates the development board. Each component is marked on a silkscreen, both
top and bottom. These marks describe connections to the microcontroller, operation modes,
and provide some useful notes. The need for additional schematics is minimized since all
relevant information is printed on the board.
Figure 1.
page
USB
EasyAVR
INTRODUCTION
MikroElektronika
Development
tools
SWITCHES
MikroElektronika
Development
tools
SWITCHES
The EasyAVR4 development board features a number of peripherial devices. In order to
enable these devices before programming, you need to check if appropriate jumpers or
switches have been properly set. Switches are devices that have two positions - ON and
OFF, which have a role to establish or break a connection between two contacts. The
EasyAVR4 development board has three groups of switches.
The first group, SW1, enables connections between the microcontroller port with analog
capabilities (PORTA) and external pull-up/down resistors. The pull-up/down resistors
should be disconnected from the analog input pins, otherwise they will affect the input voltage level. When PORTA pins are used as digital inputs/outputs, the appropriate pullup/down resistors should be enabled.
The second group, SW2, is used to enable LEDs connected to PORTA, PORTB, PORTC
and PORTD. For example, if the switch for PORTB is OFF, all PORTB LEDs will be turned
off.
The upper four switches of SW3 are used to enable SPI communication for interfacing with
MMC card. The lower four switches of SW3 are used to enable the 7-segment displays. If
you dont need the 7-segment displays in your project, these switches should be OFF.
ON
Group of 8 switches
1 2 3 4 5 6 7 8
Figure 2.
Switch is ON
Switch is OFF
page
USB
EasyAVR
JUMPERS
Jumpers, like switches, can break or establish a connection between two points. Beneath the
plastic cover of the jumper is a metal contact, which makes a connection if the jumper is
placed between two disconnected pins.
For example, the RS232 communication has two jumpers, J11 and J12, used as switches.
They are used to connect or disconnect Rx pin to PD0 and Tx pin to PD1 pin of the microcontroller. A connection is made when the jumpers are placed between two contacts.
Figure 3.
Jumper as a switch
Jumper is ON
Jumper is OFF
More often jumpers are used as a selector between two possible connections by using a three
pin connector. As illustrated in Fig. 4, the middle contact can be connected to the left or right
pin, depending on the jumpers position.
Figure 4.
Left line
is selected
Right line
is selected
Jumper as a
multiplexer
page
USB
EasyAVR
JUMPERS
MikroElektronika
Development
tools
MCU SOCKETS
MikroElektronika
Development
tools
MCU SOCKETS
EasyAVR4 is delivered with a ATmega16 40-pin microcontroller. Users can remove this one
and fit a different microcontroller in DIP40, DIP28, DIP20, DIP18, DIP14 or DIP8 packages
of an adequate pinout.
Figure 5.
MCU sockets
Note: There are two DIP40 sockets, with different pinouts (SKT1 and SKT2). When putting 40-pin microcontoller into DIP40 socket choose the one with corresponding pinout. For
example, ATmega8535 uses SKT2 socket, while ATmega8515 uses SKT1 socket.
Note: Since all packages have parallel connections, there must not be more than one microcontroller on the board at a time.
Note: Jumper J13 should be enabled only if you want to use DIP8 microcontroller with
external clock source.
page
USB
EasyAVR
Microcontrollers pins are routed to various peripherals as illustrated in Fig. 6. All ports have
direct connections to Direct Port Access connectors. Such connectors are typically used for
connecting external peripherals to the board or for providing useful points for connecting
digital logic probe.
All ports are connected to LEDs, push-button switches and pull-up/down resistors, which
allow easy monitoring and testing of digital pin state .
Some pins are connected to other peripherials such as the DS1820 temperature sensor, RS232 communication, 7-segment displays, LCD, etc.
SW2
PB5
VCC
VCC
ON
PORTB
CN2
1 2 3 4
PORTB
PB5
VCC
J2
PORTB
J6
PB5
PA0
PB0
PB1
PA1
PB2
PA2
PB4
PB5
PB6
PB7
RST
Figure 6.
System connection
VCC
GND
XT2
DIP40
PB3
PA3
PA4
DIP20
DIP28
PB5
PA5
PA6
PA7
AREF
AGND
PB5
AVCC
PC7
page
USB
EasyAVR
MCU SOCKETS
MikroElektronika
Development
tools
POWER SUPPLY
MikroElektronika
Development
tools
POWER SUPPLY
POWER SUPPLY
As a power supply source, users can select either a regulated supply from the USB cable
(default) or an external power supply. In case of the USB power supply, the system should
be connected to a PC using the USB programming cable, while the jumper J10 should be
set in the right-hand position.
SELECTABLE
In the case of an external power supply, the EasyAVR4 board produces +5V using an
LM7805 voltage regulator. The external power supply can be AC or DC, with a voltage
between 8V and 16V and the jumper J10 should be set in the left-hand position. In Fig. 7
you can see USB and external power supply connectors.
Figure 8. Power supply select jumper
USB
connector
External power
supply connector
CN7
1
2
REG1
7805
USB
EXT
USB
USB
EXT
8-16V (AC/DC)
EXT
Vin
Vout
J14
5V
FP1
5V
GND
2
E1
470uF
C1
100nF
C2
100nF
E3
470uF
C9
100nF
VCC
VCC
DD+
GND
USB
USB
connector
page
10
USB
EasyAVR
USB 2.0
IN-CIRCUIT
PROGRAMMER
Note: There is no need for manually reseting MCU after programming. The programmer
will reset the MCU automatically.
VCC
1K
POWER
VCC
VCC
10K
USB LINK
PA1
PA2
PB3
PA3
PB5
PB6
PB7
RST
VCC
OSCILLATOR
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
ATMEGAxxxx
PB2
PB4
AVRprog
On-Board USB
programmer
PA0
PB0
PB1
PA4
PA5
PA6
PA7
AREF
TO PERIPHERALS
ON DEVELOPMENT BOARD
Reset
100n
1K
SWITCH
VCC CN8
1
VCC
2
D3
D+
4
27
GND
27
USB
USB CONN.
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
USB
EasyAVR
11
MikroElektronika
Development
tools
OSCILLATOR
MikroElektronika
Development
tools
OSCILLATOR
EasyAVR4 development board has on-board oscillator circuit for generating microcontrollers clock input. Within the AVRprog programmer you can either choose internal RC
oscillator or external clock. External oscillator is connected to the XT1 pin of the microcontroller. Microcontroller in DIP8 package doesnt have pin that is dedicated only for the
oscillator clock input. Because of the small pin count, it has PB4 pin multiplexed between
I/O and clock input function.
Oscillator
Figure 12.
If you want to use pin PB4 with I/O function you should use internal RC oscillator. If you
dont need I/O function of the PB4 pin, then you can use on-board oscillator by enabling
jumper J13. By doing this, you are making a direct connection between the oscillator circuit
and PB4 pin.
Note: Jumper J13 should be enabled only if you want to use DIP8 microcontroller with
external clock source.
page
12
USB
EasyAVR
PA1
PB2
PA2
PB3
PA3
PB4
10K
PB6
PB7
RST
PB4
J13
VCC
GND
100n
Reset
VCC
XT2
XT1
PD0
PD1
PD2
74HC04
PD3
VCC
VCC
R7 1M
ATMEGAxxxx
PB1
PB5
OSCILLATOR
PA0
PB0
VCC
OSCILLATOR
MikroElektronika
Development
tools
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
E
C
D
R8
1K
GND
C11
22pF
C12
22pF
X2
8MHz
OSCILLATOR
Note: In order to simplify the schematics in this manual, the oscillator circuit is represented by this symbol.
page
USB
EasyAVR
13
LEDs
MikroElektronika
Development
tools
LEDs
Light Emitting Diodes (LEDs) are the most commonly used components, usually for displaying pins digital state. EasyAVR4 has 32 LEDs that are connected to the microcontrollers PORTA, PORTB, PORTC and PORTD.
Figure 14.
Each group of eight LEDs can be enabled or disabled using the switch SW2. Fig. 15. illustrates the connection of a LEDs to PORTA of the microcontroller. A resistor is used in series
with the LED to limit the LED's current. In this case the resistor's value is 1K.
page
14
USB
EasyAVR
MikroElektronika
Development
tools
The LEDs are enabled when the corresponding switch on SW2 is on. When enabled, LEDs
will display the state of the corresponding microcontroller pin; otherwise the LEDs will
always be off, no matter what the port state is, as no current can flow through LED.
1 2 3 4
PORTA LED
PORTB LED
CURRENT FLOW
PORTC LED
PORTD LED
PA0
PA1
RN6
1
2
3
4
5
6
7
8
9
PA3
PA4
PA6
PB1
PA1
PB2
PA2
PB3
PB4
PA7
PB5
PB6
VCC
PA0
PB0
PA5
PB7
10K
VCC
OSCILLATOR
100n
Reset
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
ATMEGAxxxx
R-SIL 8/9
10K
PA2
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
page
USB
EasyAVR
15
MikroElektronika
Development
tools
PUSHBUTTON SWITCHES
EasyAVR4 has 32 push buttons, which can be used
to change states of digital inputs to microcontroller's
ports. There is also one switch that acts as a RESET.
Reset switch schematic is shown in Figure 17.
PA0
PB0
PA1
PB2
PA2
PB3
PB4
VCC
PB5
PB6
10K
AVRprog
On-Board USB
programmer
PB7
RST
VCC
OSCILLATOR
100n
Reset
PB1
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
ATMEGAxxxx
PUSHBUTTON SWITCHES
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
Figure 18.
Pushbutton switches
page
16
USB
EasyAVR
Buttons connections to PORTA, PORTB, PORTC and PORTD are shown in Fig. 19. Jumper
J6 determines whether a button press will bring logical zero or logical one to the appropriate pin.
When button is not pressed, pin state is determined by the pull-up or pull-down port
jumpers.
In the example shown in Fig. 19, J6 is connected to +5V, therefore pressing the buttons will
bring logical one to the appropriate pins.
PORTA
RA0
PORTB
PORTC
RB0
RC0
PORTD
RB1
RC1
RD1
RA2
RB2
RC2
RD2
RC4
RB5
RC5
PB7
RD3
RD4
RST
RD5
VCC
OSCILLATOR
100n
RB4
PA3
PB6
10K
RA5
RC3
PA2
PB3
PB5
Reset
RA4
RB3
PB2
PB4
VCC
RA3
VCC
GND
XT2
XT1
PD0
RA6
RB6
RC6
RD6
RA7
RB7
RC7
RD7
PD1
PD2
PD3
0V while button
is pressed
VCC
PA1
PB1
ATMEGAxxxx
RA1
PA0
PB0
RD0
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
J6
Figure 19.
Buttons schematic
page
USB
EasyAVR
17
PUSHBUTTON SWITCHES
MikroElektronika
Development
tools
MikroElektronika
Development
tools
PUSHBPUSHBUTTON SWITCHES
vcc
J1
PORTA
pull-up
ON
PB0
PA0
PB1
PA1
PB2
PA2
PB3
PA3
PB4
PB5
PB6
PB7
RST
VCC
VCC
GND
XT2
ATMEGA
SW1
1 2 3 4 5 6 7 8
PA4
PA5
PA3
PA6
PA7
AREF
vcc
AGND
J6
AVCC
0V while pressed
PC7
vcc
J1
PORTA
ON
SW1
PB1
PA2
PB3
PA3
PB4
PB6
PB7
RST
VCC
PA1
PB2
PB5
VCC
GND
XT2
1 2 3 4 5 6 7 8
PA0
PB0
ATMEGA
pull-down
PA4
PA5
PA3
PA6
PA7
AREF
AGND
AVCC
vcc
J6
PC7
5V while pressed
page
18
USB
EasyAVR
MikroElektronika
Development
tools
8.
7
S
E
G
7-SEGMENT DISPLAYS
R
E
A
D
Y
EasyAVR4 has four 7-segment displays in multiplex mode. Data lines are connected to
PORTA, while each display is enabled through the lower four bits of PORTB.
Figure 22.
7-segment displays
8.
a
DIS3
dp
R2 - R9
PA0
PB0
PB1
PA1
PB2
PA2
PB4
PB5
10K
PB6
PB7
OSCILLATOR
100n
Reset
RST
VCC
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
ATMEGAxxxx
PB3
VCC
PA3
PA5
PA6
DIS0
AREF
10
8 7 6
10 9
8 7 6
10
8 7 6
10 9
8 7 6
3 4 5
3 4 5
3 4 5
3 4 5
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
dp
PA7
DIS1
8. 8. 8. 8.
a
b
c
d
e
f
g
PA4
DIS2
Q1
R28
10K
PD7
Q3
Q2
R29
10K
R30
10K
Q4
R31
10K
SW3
ON
PB1
PB0
1 2 3 4 5 6 7 8
PB7
PB6
PB5
PB4
PB3
PB2
SCK
MISO
MOSI
MMC-CS
DIS3
DIS2
DIS1
DIS0
USB
EasyAVR
19
GRAPHIC LCD
CONNECTOR
ON-BOARD
MikroElektronika
Development
tools
GRAPHIC LCD
A graphic LCD (GLCD) allows advanced visual messages to be displayed. While a character LCD can display only alphanumeric characters, a GLCD can be used to display messages in the form of drawings and bitmaps. The most commonly used graphic LCD has the
screen resolution of 128x64 pixels. Before a GLCD is connected, the user needs to set the
jumper J8 (Fig. 24) to the upper position. The GLCDs contrast can be adjusted using the
potentiometer P1, which is placed to the right of the GLCD.
Figure 24.
GLCD selection jumper
In order to enable GLCD,
jumper J8 should be set to
the upper position, labeled
as GRAPH.
GLCD
Figure 25.
J8
GRAPH.
CHAR.
Vee
GLCD contrast
selected
LCD8 contrast
selected
VCC
VCC
PA0
PA1
R19 10
Vo
PB3
VCC
PB4
VCC
PB5
RST
VCC
VCC
OSCILLATOR
GND
100n
20
Reset
PB7
PD4
PD5
PD6
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PD7
PD2
PD3
10K
PB6
XT2
Figure 26.
XT1
PD0
GLCD schematic
CS1
CS2
PD1
PD2
PD3
RS
R/W
E
PA2
ATMEGAxxxx
P1 10K
Contrast
Adjustment
PB0
PB1
PB2
CS1
CS2
GND
VCC
Vo
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
RST
Vee
LED+
LED-
PA3
PA4
PA5
PA6
PA7
D0
D1
D2
D3
D4
D5
D6
D7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
RST
page
20
USB
EasyAVR
2x16 LCD
CONNECTOR
2x16 LCD
ON-BOARD
Figure 27.
LCD 2x16 in 4-bit mode
PA0
PB0
PB1
PA1
PB2
PA2
PB4
PB5
10K
PB6
PB7
VCC
VCC
OSCILLATOR
GND
100n
Reset
RST
XT2
XT1
PD4
GND
PD6
GND
GND
GND
GND
PA4
PA5
PA6
PA7
P2
10K
Contrast
Adjustment
PD0
PD1
14
GND
VCC
VEE
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
Figure 28.
PD2
PD3
RS
LCD Display
4-bit mode
PD4
ATMEGAxxxx
PB3
VCC
VCC
PA3
PA4
PA5
PA6
PA7
D4
D5
D6
D7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PD5
PC0
PD6
PD7
page
USB
EasyAVR
21
MikroElektronika
Development
tools
CONNECTOR
2x16 LCD
ON-BOARD
MikroElektronika
Development
tools
The LCD must be placed in the marked position with two free pins to the left and four free
pins to the right. It is important to note that the LCD should be placed or removed from
EasyAVR4 only when the power is off. Before attaching the LCD, set jumper J8 to the lower
position. The LCD's contrast can be adjusted using potentiometer P1 which is located to the
right of the GLCD/LCD connector.
NOTE: Special attention is required when placing the LCD. Otherwise the LCD can be permanently damaged.
page
22
USB
EasyAVR
J8
GRAPH.
Vee
GLCD contrast
selected
LCD8 contrast
selected
VCC
CHAR.
VCC
PA1
PB2
PA2
PB3
Vo
PB4
VCC
PB5
10K
PB6
PD4
PD5
PD6
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PB7
VCC
VCC
OSCILLATOR
GND
100n
14
Reset
RST
GND
VCC
VEE
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
PA0
PB1
XT2
XT1
LCD Display
8-bit mode
PD0
PD1
PD2
PD3
RS
R/W
E
ATMEGAxxxx
P1 10K
Contrast
Adjustment
PB0
PA3
PA4
PA5
PA6
PA7
D0
D1
D2
D3
D4
D5
D6
D7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
page
USB
EasyAVR
23
MikroElektronika
Development
tools
R S- 2 3 2 C O M M U N I C A T I O N
MikroElektronika
Development
tools
In order to provide a more flexible system, the microcontroller is connected to the MAX232
through the two jumpers: J11 and J12. The jumper J11 is used to connect the Rx line to PD0
pin. The jumper J12 is used to connect the Tx line to PD1 pin.
page
24
USB
EasyAVR
Figure 32.
Connection between microcontroller and a PC
PC
6
RS-232
CON
CONNECT
MCU TO PC
Receive
data (Rx)
SERIAL
CABLE
CONNECT
PC TO MCU
6
RS-232 A
CON
CN9
SUB-D 9p
4
9
5
2
7
3
Send
Data (Tx)
VCC
C18
100nF
E12
10uF
C2+
C2VS-
T2OUT
R2IN
VCC
GND
T1OUT
R1IN
R1OUT
T1IN
T2IN
R2OUT
16
15
14
13
12
11
10
9
PB5
PB6
PB7
RST
J12
J11
Rx
Tx
VCC
OSCILLATOR
100n
C1-
PA2
PB4
10K
VS+
PA1
PB2
PB3
VCC
Reset
E10
10uF
C1+
MAX232
E11
10uF
1
2
3
4
5
6
7
8
PB1
VCC
GND
XT2
XT1
PD0
PD1
PD2
RS232 COMM.
Disabled
RS232 COMM.
Enabled
PD3
ATMEGAxxxx
VCC
U6
E9
10uF
PA0
PB0
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
page
USB
EasyAVR
25
R S- 2 3 2 C O M M U N I C A T I O N
MikroElektronika
Development
tools
MikroElektronika
Development
tools
DS1820
PA1
PB2
PA2
PB3
125 C
PB4
VCC
PB5
10K
PB6
PB7
-55 C
VCC
DS1820
VCC
OSCILLATOR
100n
Reset
RST
VCC
GND
XT2
XT1
VCC
GND
PA0
PB0
PB1
VCC
PD0
R1
10K
PD1
PD2
PD3
DQ
J7
ATMEGAxxxx
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
Figure 34.
DQ line is
connected to PC6
DQ line is
connected to PC7
DQ line is
disconnected
DS1820 schematic
page
26
USB
EasyAVR
VREF
4.096V
ON-BOARD
Analog input pins are placed on PORTA of microcontroller. In order to measure analog signal without interference, turn the coresponding switch on SW1 to OFF position. This will
disable connection of the used PORTA pin to the pull-up/down resistors.
Applications of A/D Conversion are various. Microcontroller takes analog signal from its
input pin and translates it into a digital value. Basically, you can measure any analog signal
that fits in range acceptable by MCU. With 4.096V voltage reference used (jumper J9 in
lower position) this range is 0V-4.096V. If you place jumper J9 in upper position 5V will be
used as voltage reference and therefor measure range will be 0V-5V.
page
USB
EasyAVR
27
MikroElektronika
Development
tools
MikroElektronika
Development
tools
Pull-up/down resistors on
PORTA analog input pins
should be disabled using
SW1
vcc
VCC
J1
PORTA
pull-up
R12
1K
J9
REF1
ON
SW1
AREF
VCC
MCP
1541
E14
10uF
3 VOUT
VIN 1
GND 2
R11
100
PB0
PA0
PB1
PA1
PB2
PA2
PB3
PB4
VCC
PB5
10K
PB6
PB7
5V voltage
reference
VCC
OSCILLATOR
100n
4.096V voltage
reference
Reset
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
ATMEGAxxxx
PA3
PA4
PA5
PA6
PA7
1 2 3 4 5 6 7 8
ADC0
ADC1
ADC2
ADC3
ADC4
ADC5
ADC6
ADC7
AREF
AGND
AVCC
VCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
Figure 36.
4.096V voltage reference schematic
page
28
USB
EasyAVR
These connectors can be used for system expansion with external boards such as Serial
Ethernet, Compact Flash, MMC/SD, ADC, DAC, CAN, RTC, RS-485, etc. Ensure that the
on-board peripherals are disconnected from microcontroller by setting the appropriate
jumpers, while external peripherals are using the same pins. The connectors can also be used
for attaching logic probes or other test equipment.
Figure 38.
Example of how to connect
external peripheral with flat
cable
page
USB
EasyAVR
29
MikroElektronika
Development
tools
MikroElektronika
Development
tools
Pull-up line is
connected
VCC
J3
2
3
RN3
Pull-down line
is connected
All lines
are disconnected
1
PC0 2
PB0
PA0
PB1
PA1
PB2
PA2
PC3 5
PB3
PA3
PC4
PC5
PC6
PC7
PB4
VCC
PB5
10K
PB6
PB7
VCC
OSCILLATOR
100n
Reset
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
ATMEGAxxxx
PA4
PA5
PA6
PC1 3
PC2 4
6
7
8
9
PA7
AREF
AGND
RPACK8/9
8x10K
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
Figure 39.
PORTC connection
CN3
PC0
PC1
PC2
PC3
PC4
PC5
PC6
PC7
VCC
HEADER 5x2
page
30
USB
EasyAVR
JTAG CONNECTOR
JTAG connector can be used as serial programming interface or On-Chip debug system. For
the On-chip Debug system, in addition to the JTAG interface pins, the RESET pin is monitored by the debugger to be able to detect external reset sources. The debugger can also pull
the RESET pin low to reset the whole system. The JTAG interface is accessed through four
of the microcontrollers pins:
- TMS: Test Mode Select,
- TCK: Test Clock,
- TDI: Test Data In,
- TDO: Test Data Out.
PA0
PB0
PB1
PA1
PB2
PA2
PB4
PB5
10K
PB6
PB7
RST
VCC
OSCILLATOR
100n
Reset
mRST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
ATMEGAxxxx
PB3
VCC
PD4
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
JTAG
CONNECTOR
PC2
PC1
PD5
PC0
PD6
PD7
VCC
Figure 40.
VCC
CN6
TCK
GND
TDO
VTref
TMS
nSRST
nTRST
Vsupply
TDI
mRST
NC
GND
page
USB
EasyAVR
31
JTAG CONNECTOR
MikroElektronika
Development
tools
MikroElektronika
Development
tools
SUPPORTED
MMC card is used as storage media for a portable devices, in a form that can easily be
removed for access by a PC. For example, a digital camera would use an MMC card for
storing image files. With an MMC reader (typically small box that connects via USB or
some other serial connection) you can easily transfer data from MMC card to your computer. Microcontroller on EasyAVR4 communicates with Multi Media Card via SPI communication.
Modern computers, both laptops and desktops, often
have SD slots, which can
read MMC cards.
Figure 41.
MMC slot on-board
To enable MMC card you must turn on switches 1, 2, 3 and 4 on SW3. By doing that, microcontrollers SPI comunnication lines (SDI, SDO and SCK) and Chip Select are connected to
MMC. Working voltage of EasyAVR4 is 5V DC, while working voltage of MMC card is
3.3V DC. Because of that, there is a voltage regulator on-board with MMC card
(MC33269DT-3.3). Data lines from microcontroller to MMC card must be also adjusted to
3.3V. It is done with resister voltage dividers as shown on Figure 42.
page
32
USB
EasyAVR
MikroElektronika
Development
tools
SPI-SDI
MMC-CS#
SPI-SDO
SPI-SCK
R13
2K2
R15
2K2
VCC3
R17
2K2
CN12
1
2
3
4
5
6
7
R14
3K3
R18
3K3
R16
3K3
MC33269
DT-3.3
C19
100nF GND
1
2
C20
100nF
MMC/SD
CARD
REG2
VCC
VCC3
CS
Din
GND
+3.3V
SCK
GND
Dout
VCC
VIN
VOUT
VCC3
E15
10uF
SW3
MMC-CS#
ON
SPI-SDI
SPI-SDO
PB7
PA0
PB0
PB6
PB5
PB4
PB1
PA1
PB2
PA2
PB3
PB4
VCC
PB5
10K
PB6
PB7
VCC
OSCILLATOR
100n
Reset
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
ATMEGAxxxx
1 2 3 4 5 6 7 8
SPI-SCK
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PD4
PC1
PD5
PC0
PD6
PD7
page
USB
EasyAVR
33
MikroElektronika
Development
tools
34
USB
EasyAVR