mikroElektronika EasyAVR4 User Manual

SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
MikroElektronika
Development tools - Books - Compilers
Software and Hardware
solutions for Embedded World
EasyAVR4
Users Manual
2 in 1
ATMEL
DEVELOPMENT
BOARD
AVR
DEVELOPMENT
BOARD
AVR
ATMEL
USB 2.0
USB 2.0
IN-CIRCUIT
IN-CIRCUIT
PROGRAMMER
PROGRAMMER
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
22
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
No part of this manual, including the product and software described in it, may be repro­duced, 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 pur­poses, 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 PARTIC­ULAR PUROSE.
IN NO EVENT SHALL MIKROELEKTRONIKA, ITS DIRECTORS, OFFICERS, EMPLOY­EES 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 WITH­OUT 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 trade­marks or copyrights of their respective companies, and are used only for identification or explanation and to the owners benefit, without intent to infringe.
Second edition December 2006
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
33
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
CCOONNTTEENNTTSS
CONNECTING THE SYSTEM page 4
INTRODUCTION page 5
Power Supply page 10
On-board USB 2.0 programmer page 11
Jumpers page 7
Switches page 6
MCU sockets page 8
LEDs page 14
Pushbutton switches page 16
MMC/SD (Multimedia Card) page 32
7-segment displays page 19
Graphic LCD page 20
LCD 2x16 in 4-bit mode page 21
LCD 2x16 in 8-bit mode page 22
4.096V voltage regulator page 27
CONTENTS
DESCRIPTION OF THE DEVELOPMENT SYSTEM page 5
JTAG connector page 31
Direct Port Access page 29
RS-232 Communication page 24
DS1820 Digital Thermometer page 26
Oscillator page 12
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
44
page
CCOONNNNEECCTTIINNGG TTHHEE SSYYSSTTEEMM
CONNECTING THE SYSTEM
Step no.1
Step no.2
Step no.3
Step no.4
The development system box contains the development system, product CD, USB cable, RS232 cable and this manual.
The first thing to do is to take the system out of the box. Unpack the USB cable and con­nect it to the PC. Please use USB ports on the back of the PC with direct connection to the motherboard.
Install the AVRprog programmer and drivers. Start the installation from the product CD:
CD_Drive:\product\zip\AVRprog_setup.exe.
After the installation connect the USB cable to the EasyAVR4 board. You will be asked for the AVRprog drivers. Point to them in order to finish the driver installation. They are placed in the folder:
System_Drive:\Program Files\Mikroelektronika\AVRFLASH\Driver.NT
Run and use AVRprog as explained in the document ‘AVRprog programmer’.
CD_Drive:\product\pdf\avrprog_manual.pdf.
After these 4 steps, your EasyAVR4 is installed and ready for use. You can try to read a pro­gram from the chip or to load an example from the examples folder of mikroElektronika’s compilers for AVR or from the product CD:
CD_Drive:\product\zip\easyavr4_examples.zip.
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
55
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
IINNTTRROODDUUCCTTIIOONN
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 inter­faced with external circuits and a broad range of peripheral devices, allowing a user to con­centrate 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.
INTRODUCTION
Figure 1.
EasyAVR4 development board
ATMEL
DEVELOPMENT
BOARD
AVR
DEVELOPMENT
BOARD
AVR
ATMEL
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
66
page
SSWWIITTCCHHEESS
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 volt­age level. When PORTA pins are used as digital inputs/outputs, the appropriate pull­up/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 don’t need the 7-segment displays in your project, these switches should be OFF.
Figure 2.
Group of 8 switches
Switch 1 is ON, and other switches are OFF
1
432 5876
ON
Switch is ON
Switch is OFF
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
77
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
JJUUMMPPEERRSS
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 micro­controller. A connection is made when the jumpers are placed between two contacts.
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 jumper’s position.
Left line
is selected
All lines are
disconnected
Right line
is selected
Figure 3.
Figure 4.
Jumper as a switch
Jumper as a multiplexer
Jumper is ON
Jumper is OFF
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
88
page
MMCCUU SSOOCCKKEETTSS
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.
Note: Since all packages have parallel connections, there must not be more than one micro-
controller on the board at a time.
Figure 5.
MCU sockets
Note: Jumper J13 should be enabled only if you want to use DIP8 microcontroller with
external clock source.
Note: There are two DIP40 sockets, with different pinouts (SKT1 and SKT2). When put-
ting 40-pin microcontoller into DIP40 socket choose the one with corresponding pinout. For example, ATmega8535 uses SKT2 socket, while ATmega8515 uses SKT1 socket.
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
99
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
MMCCUU SSOOCCKKEETTSS
Microcontroller’s 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, RS­232 communication, 7-segment displays, LCD, etc.
System connection
Figure 6.
PORTB
CN2
PB5
VCC
SW2
1
PB5
ON
432
VCC
J6
PB5
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
PORTB
PA0
PA1
PA2
DIP40
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PORTB
USB
4
VCC
J2
DIP28
PB5
DIP20
PB5
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
1100
page
PPOOWWEERR SSUUPPPPLLYY
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.
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.
2
POWER SUPPLY
J10 in the left-hand position: system will take power from the
external AC/DC
power adapter.
J10 in the right-hand
position: system will take power from the
USB cable.
USB and power supply connectors
Figure 7.
Figure 8.
Power supply select jumper
Figure 9.
J10 is set to USB power supply
EXT
USB
USB
connector
USB
connector
External power
supply connector
POWER SUPPLY
SELECTABLE
POWER SUPPLY
SELECTABLE
CN7
1
2
8-16V (AC/DC)
+
E1 470uF
REG1 7805
1
C1 100nF
Vin
Vout
GND
EXT
EXT
5V
3
C2 100nF
J14
E3 470uF
USB
USB yPower Suppl
External Power Supply
USB
FP1
C9 100nF
5V
VCC
D­D+ GND
USB
VCC
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
1111
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
OONN--BBOOAARRDD UUSSBB PPRROOGGRRAAMMMMEERR
ON-BOARD USB 2.0 PROGRAMMER
There is no need for the use of external equipment during programming, as the EasyAVR4 development system has its own on-board USB 2.0 programmer.
All you need to do is connect the system to a PC using the USB cable. Then, load your program into the microcontroller via the AVRprog programming software, which is supplied with the board.
VCC
USB LINK
27
SWITCH
TO PERIPHERALS
ON DEVELOPMENT BOARD
AVRprog
On-Board USB
programmer
VCC D­D+ GND
USB
CN8
1 2 3 4
USB CONN.
VCC
27
1K
POWER
1K
10K
Reset
100n
VCC
VCC
ATMEGAxxxx
PB1
PB2
PB3
PB4
PD1
PD2
PB5
PB6
PB7
PD4
PD5
PD6
PC1
PC0
PD7
PC2
PC3
PC4
PC5
PC6
PC7
PA7
PA6
PA5
PA4
PA3
PA2
PA0
PA1
PD3
PB0
PD0
RST
VCC
GND
XT2
XT1
AREF
AGND
AVCC
VCC
OSCILLATOR
Figure 10.
On-Board USB programmer
Figure 11.
Switch schematic
Note: There is no need for manually reseting MCU after programming. The programmer
will reset the MCU automatically.
USB 2.0
USB 2.0
IN-CIRCUIT
IN-CIRCUIT
PROGRAMMER
PROGRAMMER
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
1122
page
OOSSCCIILLLLAATTOORR
OSCILLATOR
EasyAVR4 development board has on-board oscillator circuit for generating microcon­troller’s 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 microcon­troller. Microcontroller in DIP8 package doesn’t 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.
Figure 12.
Oscillator
Note: Jumper J13 should be enabled only if you want to use DIP8 microcontroller with
external clock source.
If you want to use pin PB4 with I/O function you should use internal RC oscillator. If you don’t 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.
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
1133
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
OOSSCCIILLLLAATTOORR
Figure 13.
Oscillator connection with MCU
Note: In order to simplify the schematics in this man-
ual, the oscillator circuit is represented by this symbol.
J13
PB4
OSCILLATOR
74HC04
A
B
C
GND
VCC
10K
Reset
100n
VCC
F
E
D
VCC
R7 1M
R8 1K
VCC
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PA0
PA1
PA2
ATMEGAxxxx
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
X2
8MHz
C11
C12
22pF
22pF
USB
4
OSCILLATOR
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
1144
page
LLEEDDss
Light Emitting Diodes (LEDs) are the most commonly used components, usually for dis­playing pin’s digital state. EasyAVR4 has 32 LEDs that are connected to the microcon­troller’s PORTA, PORTB, PORTC and PORTD.
LEDs
Figure 14.
Light Emitting Diodes
Each group of eight LEDs can be enabled or disabled using the switch SW2. Fig. 15. illus­trates 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.
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
1155
page
EasyAVR
EasyAVR4 Users Manual
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.
Figure 15.
LED schematic
ON
PORTALED
PORTB LED
PORTC LED
PORTD LED
CURRENT FLOW
1
432
PA0
PA1
RN6
VCC
PA2
PA3
PA4
PA5
PA6
PA7
PB0
PB1
PB2
ATMEGAxxxx
PB3
PB4
PB5
PB6
10K
VCC
Reset
OSCILLATOR
100n
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
R-SIL 8/9
10K
1 2 3 4 5 6
7 8
9
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
1166
page
PPUUSSHHBBUUTTTTOONN SSWWIITTCCHHEESS
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.
PUSHBUTTON SWITCHES
Figure 18.
Pushbutton switches
Figure 16.
Reset switch
Figure 17.
Reset switch schematic
VCC
10K
Reset
AVRprog
On-Board USB
programmer
100n
OSCILLATOR
VCC
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PA0
PA1
ATMEGAxxxx
PA2
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
1177
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
PPUUSSHHBBUUTTTTOONN SSWWIITTCCHHEESS
Figure 19.
Buttons schematic
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 appropri­ate 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
RA1
RA2
RA3
RA4
RA5
RA6
RA7
PORTB
RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7
VCC
PORTC
J6
RC7
RC0
RC1
RC2
RC3
RC4
RC5
RC6
PORTD
RD0
RD1
RD2
RD3
RD4
RD5
RD6
RD7
0V while button
is pressed
VCC
Reset
+5V while button
is pressed
PB0
PB1
PB2
PB3
PB4
PB5
VCC
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
10K
OSCILLATOR
100n
PA0
PA1
PA2
ATMEGAxxxx
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
1188
page
PPUUSSHHBBPPUUSSHHBBUUTTTTOONN SSWWIITTCCHHEESS
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.
Figure 20.
Figure 21.
Button with pull-up resistor
Button with pull-down resistor
VCC
PB0
PB1
PB2
ATMEGA
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
vcc
J1
SW1
ON
1
vcc
PORTA
J6
pull-up
8765432
PA3
0V while pressed
vcc
J1
PORTA
pull-down
VCC
PB0
PB1
PB2
ATMEGA
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
AREF
AGND
AVCC
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PC7
SW1
ON
1
vcc
8765432
PA3
J6
5V while pressed
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
1199
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
7-SEGMENT DISPLAYS
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.
8.
8.
8.
8.
8.
Figure 22.
7-segment displays
Figure 23.
7-segment displays schematic
8.
8.
7
7
S
S
E
E
8.
8.
G
G
R
R
E
E
A
A
D
D
Y
Y
a
b
f
g
VCC
10K
OSCILLATOR
Reset
100n
e
8.
VCC
c
dp
d
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PA0
PA1
PA2
ATMEGAxxxx
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
R2-R9
a
b c
d e f g
dp
SW3
1
PB7 PB6 PB5 PB4 MMC-CS PB3 PB2
PB1
PB0
8765432
ON
SCK MISO MOSI
DIS3
DIS2
DIS1
DIS0
DIS3 DIS2 DIS1 DIS0
10 9 8
8.
123
R28
10K
7
4
Q1
6
10
8.
5
123
R29
10K
98
6
10 9 8
7
5
123
4
Q2
R30
10K
6
7
8.
5
4
Q3
98
10
8.
123
R31
10K
6
7
5
4
Q4
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
2200
page
GGRRAAPPHHIICC LLCCDD 112288XX6644
In order to enable GLCD, jumper J8 should be set to the upper position, labeled as GRAPH.
GRAPHIC LCD
A graphic LCD (GLCD) allows advanced visual messages to be displayed. While a charac­ter LCD can display only alphanumeric characters, a GLCD can be used to display mes­sages 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 GLCD’s contrast can be adjusted using the potentiometer P1, which is placed to the right of the GLCD.
Figure 26.
GLCD schematic
Figure 24.
Figure 25.
GLCD selection jumper
GLCD
GRAPHIC LCD
GRAPHIC LCD
CONNECTOR
CONNECTOR
ON-BOARD
ON-BOARD
GLCD contrast
selected
LCD8 contrast
selected
GLCD and LCD8
contrast not selected
GRAPH.
CHAR.
J8
Vee
VCC
VCC
Contrast
Adjustment
P1 10K
Vo
PA1
PA0
PA2
PA3
PD2
PD3
PD4
1
Vo
RS
CS1
CS2
VCC
GND
PA5
PA4
PD6
PD5
E
D1
D2
D0
D3
D5
D4
R/W
R19 10
VCC
PA7
PA6
PD7
20
D7
D6
Vee
RST
LED-
LED+
VCC
10K
Reset
VCC
OSCILLATOR
100n
D0
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
CS1
PD2
CS2
PD3
RS
PD4
R/W
PD5
E
PD6
PA0
D1
PA1
D2
PA2
ATMEGAxxxx
AREF
AGND
AVCC
D3
PA3
D4
PA4
D5
PA5
D6
PA6
D7
PA7
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
RST
PD7
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
2211
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
LLCCDD 22XX1166 IINN 44--BBIITT MMOODDEE
2x16 LCD
A standard character LCD is probably the most widely used data visualization component. Usually, it can display two lines of 16 alphanumeric characters, each made up of 5x8 pix­els. The character LCD communicates with the microcontroller via a 4-bit or 8-bit data bus, each requiring the use of a different connector on EasyAVR4. For 4-bit data bus use, the LCD should be placed in the upper left of the board, just above the LEDs. The connection to the microcontroller is shown in Fig. 28 where there are only four data lines. It is impor­tant to note that the LCD should be placed or removed from EasyAVR4 only when the power is off.
LCD 2X16 IN 4-BIT MODE
Figure 27.
Figure 28.
LCD 2x16 in 4-bit mode
LCD 2x16 in 4-bit mode schematics
2x16 LCD
2x16 LCD
CONNECTOR
CONNECTOR
2x16 LCD
ON-BOARDON-BOARD
USB
4
P2
10K
VCC
Contrast Adjustment
PA7
PA6
PA5
PA4
PD6
PD4
GND
GND
GND
GND
114
GND
GND
E
D1
D2
D0
D7
D3
D6
D5
D4
RS
R/W
VEE
VCC
LCD Display 4-bit mode
VCC
10K
Reset
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
RST
VCC
VCC
OSCILLATOR
100n
GND
XT2
XT1
PD0
PD1
PD2
PD3
RS
PD4
PD5
E
PD6
PA0
PA1
PA2
ATMEGAxxxx
PA3
D4
PA4
D5
PA5
D6
PA6
D7
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
2222
page
LLCCDD IINN 88--BBIITT MMOODDEE
2x16 LCD2x16 LCD
2x16 LCD
CONNECTOR
2x16 LCD
CONNECTOR
ON-BOARDON-BOARD
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.
LCD 2X16 IN 8-BIT MODE
When using a character LCD in 8-bit mode, the connector that is shared with the GLCD should be used. Since this connector has 20 pins and the character LCD has only 14 pins, special attention is required when placing the LCD. Otherwise the LCD can be permanent­ly damaged.
Figure 29.
LCD 2x16 in 8-bit mode
NOTE: Special attention is required when placing the LCD. Otherwise the LCD can be per-
manently damaged.
View from the back: shows which pins stays disconnected.
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
2233
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
LLCCDD 22XX1166 IINN 88--BBIITT MMOODDEE
Figure 30.
LCD 8-bit mode schematic
Leave two free pins to the left side
Leave four free pins to the right side
In order to enable LCD, jumper J8 should be set to the lower position, labeled as CHAR.
GRAPH.
J8
CHAR.
P1 10K
Contrast
Adjustment
Vee
VCC
VCC
Vo
PA1
PA0
PA2
PA7
PA3
PA6
PA5
PA4
PD6
PD5
PD4
114
GND
VCC
E
D1
D2
D0
RS
R/W
VEE
D7
D3
D6
D5
D4
LCD Display 8-bit mode
GLCD contrast
selected
LCD8 contrast
selected
GLCD and LCD8
contrast not selected
VCC
10K
Reset
OSCILLATOR
100n
VCC
R/W
D0
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
RS
PD4
PD5
E
PD6
PA0
D1
PA1
D2
PA2
ATMEGAxxxx
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
D3
D4
D5
D6
D7
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
2244
page
RRSS--223322 CCOOMMMMUUNNIICCAATTIIOONN
RS-232 COMMUNICATION
RS-232 communication enables point-to-point data transfer. It is commonly used in data acquisition applications, for the transfer of data between the microcontroller and a PC. Since the voltage levels of a microcontroller and PC are not directly compatible with each other, a level transition buffer such as the MAX232 must be used.
Figure 31.
RS232 connectors
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.
ENABLEDENABLED
RS232RS232
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
2255
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
RRSS--223322 CCOOMMMMUUNNIICCAATTIIOONN
Figure 32.
Connection between microcontroller and a PC
RS-232
CON
PC
69
15
SERIAL CABLE
RS-232 A
CON
VCC
E9
10uF
E11
10uF
E10
10uF
6
9
15
1
2
9
8
7
3
C18 100nF
1 2 3 4 5 6 7 8
6
U6
C1+
MAX232
VS+
C1-
C2+
C2-
VS-
T2OUT
R2IN
RS232 COMM.
T1OUT
R1OUT
R2OUT
VCC
GND
R1IN
T1IN
T2IN
Disabled
16 15 14 13 12
10
E12 10uF
11
5
4
VCC
9
CONNECT MCU TO PC
CONNECT PC TO MCU
CN9 SUB-D 9p
J11J12
RS232 COMM.
Enabled
Receive data (Rx)
Send Data (Tx)
Rx
Tx
VCC
10K
Reset
100n
OSCILLATOR
VCC
PB0
PB1
PB2
ATMEGAxxxx
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
2266
page
DDSS11882200 DDIIGGIITTAALL TTHHEERRMMOOMMEETTEERR
DS1820 digital thermometer is well suited to envi­ronmental temperature measurement, having the temperature range of -55°C to 125°C and the accura­cy of +/-0.5°C. It must be placed correctly in the 3­pin socket provided on EasyAVR4, with its rounded side to the lower edge of the board (see Fig. 33) oth­erwise the DS1820 could be permanently damaged. DS1820’s data pin can be connected to either PC6 or PC7 pin, which is determined by jumper J7.
There is a mark in the form of half-cir­cle for proper ori­entation of DS1820 sensor.
DS1820 DIGITAL THERMOMETER
Figure 33.
Figure 34.
DS1820
DS1820 schematic
125 C
-55 C
DS1820
VCC
GND
VCC
DQ
10K
VCC
10K
Reset
VCC
R1
J7
OSCILLATOR
100n
VCC
PB0
PB1
PB2
ATMEGAxxxx
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
DQ line is
connected to PC6
DQ line is
connected to PC7
DQ line is
connecteddis
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
2277
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
44..009966VV VVOOLLTTAAGGEE RREEFFEERREENNCCEE
4.096V VOLTAGE REFERENCE
Figure 35.
4.096V voltage reference
Some of the Atmel’s microcontrollers have integrated A/D Converter (Analog-to-Digital Converter). In order for A/D Converter to work, voltage reference must be used. It repre­sents a maximum value that can be measured by microcontroller. EasyAVR4 uses 4.096V voltage reference because number 4096 is a power of 2 which makes it easy to represent val­ues as binary numbers in microcontroller. In case of the 10-bit A/D Converter the resolution will be 4mV per bit. In case of the 12-bit A/D Converter the resolution will be 1mV per bit.
Analog input pins are placed on PORTA of microcontroller. In order to measure analog sig­nal 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.
VREF
VREF
4.096V
4.096V
ON-BOARD
ON-BOARD
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
2288
page
44..009966VV VVOOLLTTAAGGEE RREEFFEERREENNCCEE
Figure 36.
4.096V voltage reference schematic
Pull-up/down resistors on PORTA analog input pins should be disabled using SW1
VCC
4.096V voltage reference
VIN
REF1
MCP 1541
1
GND
2
5V voltage
reference
PORTA
vcc
J1
pull-up
VCC
R12 1K
J9
ADC0
ADC1
ADC2
ADC3
ADC4
ADC5
ADC6
ADC7
VCC
SW1
ON
1
8765432
AREF
E14
3
VOUT
R11 100
VCC
10K
Reset
100n
10uF
OSCILLATOR
VCC
PB0
PB1
PB2
ATMEGAxxxx
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
2299
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
DDIIRREECCTT PPOORRTT AACCCCEESSSS
DIRECT PORT ACCESS
Direct port access connectors
Example of how to connect
external peripheral with flat
cable
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.
All microcontroller input/output pins can be accessed via connectors placed along the right side of the board. For each of PORTA, PORTB, PORTC, PORTD and PORTE there is one 10-pin connector providing VCC, GND and up to eight port pins.
Figure 37.
Figure 38.
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
3300
page
DDIIRREECCTT PPOORRTT AACCCCEESSSS
ATMEGAxxxx
PB1
PB2
PB3
PB4
PD1
PD2
PB5
PB6
PB7
PD4
PD5
PD6
PC1
PC0
PD7
PC2
PC3
PC4
PC5
PC6
PC7
PA7
PA6
PA5
PA4
PA3
PA2
PA0
PA1
PD3
PB0
PD0
RST
VCC
GND
XT2
XT1
AREF
AGND
AVCC
VCC
OSCILLATOR
10K
Reset
100n
VCC
PC4
PC6
PC0
PC2
PC5
PC7
PC1
PC3
HEADER 5x2
CN3
PC6 PC7
PC4 PC5
PC2
PC3
PC0
PC1
8 9
6 7
4
5
2
3
1
2 3
1
J3
Pull-up line is
connected
All lines
are disconnected
Pull-down line
is connected
RN3
RPACK8/9
8x10K
VCC
VCC
Figure 39.
PORTC connection
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
3311
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
JJTTAAGG CCOONNNNEECCTTOORR
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 mon­itored 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 microcontroller’s pins:
- TMS: Test Mode Select,
- TCK: Test Clock,
- TDI: Test Data In,
- TDO: Test Data Out.
ATMEGAxxxx
PB1
PB2
PB3
PB4
PD1
PD2
PB5
PB6
PB7
PD4
PD5
PD6
PC1
PC0
PD7
PC2
PC3
PC4
PC5
PC6
PC7
PA7
PA6
PA5
PA4
PA3
PA2
PA0
PA1
PD3
PB0
PD0
RST
VCC
GND
XT2
XT1
AREF
AGND
AVCC
VCC
OSCILLATOR
10K
Reset
100n
VCC
TMS
Vsupply
TCK
TDO
nSRST
nTRST
GND
VTref
HEADER 5x2
CN6
VCC
TDI
GND
JTAG
CONNECTOR
VCC
NC
mRST
mRST
JTAG CONNECTOR
Figure 40.
JTAG connector schematic
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
3322
page
MMMMCC//SSDD ((MMUULLTTIIMMEEDDIIAA)) CCAARRDD
To enable MMC card you must turn on switches 1, 2, 3 and 4 on SW3. By doing that, micro­controller’s 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.
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 comput­er. Microcontroller on EasyAVR4 communicates with Multi Media Card via SPI communi­cation.
MMC/SD (MULTIMEDIA CARD)
Figure 41.
MMC slot on-board
Modern computers, both lap­tops and desktops, often have SD slots, which can read MMC cards.
MMC/SD
MASS STORAGE
MMC/SD
MASS STORAGE
SUPPORTED
SUPPORTED
256MB
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
3333
page
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
MMMMCC//SSDD ((MMUULLTTIIMMEEDDIIAA CCAARRDD))
Figure 42.
MMC schematic
SPI-SDI
MMC-CS#
SPI-SDO
SPI-SCK
R13 2K2
R14 3K3
R15 2K2
R16 3K3
R17 2K2
R18 3K3
VCC3
1
CS
2
Din
3
GND
4
+3.3V
5
SCK
6
GND
7
Dout
CN12
MMC/SD
CARD
SPI-SCK
SPI-SDI SPI-SDO
MMC-CS#
VCC3
C20 100nF
1
8765432
VCC
SW3
C19 100nF
ON
1
PB7
PB6
PB5
PB4
GND
REG2
MC33269
DT-3.3
2
3
VOUT
E15 10uF
VIN
VCC
VCC3
VCC
10K
Reset
100n
OSCILLATOR
VCC
PB0
PB1
PB2
ATMEGAxxxx
PB3
PB4
PB5
PB6
PB7
RST
VCC
GND
XT2
XT1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
AREF
AGND
AVCC
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
PD7
USB
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
EasyAVR
EasyAVR4 Users Manual
MikroElektronika Development tools
3344
page
If you are experiencing problems with any of our products or you just want additional information, please let us know. We are committed to meeting your every need.
Technical Support :
support@mikroe.com
If you have any other question, comment or a business proposal, please contact us:
E-mail: office@mikroe.com Web: www.mikroe.com Forum: www.mikroe.com/forum/
USB
4
Loading...