Easyavr v7 Manual v101-238271
Easyavr v7 Manual v101-238271
Easyavr v7 Manual v101-238271
microcontrollers supported The ultimate AVR board Supports 3.3V and 5V devices Dual Power Supply Easily add extra boards mikroBUS sockets Four connectors for each port Amazing Connectivity As fast as it gets USB 2.0 programmer
USER'S GUIDE
EasyAVR
v7
Table of contents
Introduction
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . It's good to know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Connectivity
04 05
mikroBUS sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Input/Output Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16 18
Power Supply
Dual power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displays
06
LCD 2x16 characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GLCD 128x64. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Touch panel controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20 21 22 23
Supported MCUs
Supported microcontrollers . . . . . . . . . . . . . . . . . . . . . . . .
08
Modules
DS1820 - Digital Temperature Sensor . . . . . . . . . . . . . .
Programming
On-board programmer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installing programmer drivers . . . . . . . . . . . . . . . . . . . . . . Programming software . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24 25 26 27 28 29
10 12 13
LM35 - Analog Temperature Sensor . . . . . . . . . . . . . . . . ADC inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I2C EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Piezo Buzzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Additional GNDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Communication
UART via RS-232 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UART via USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14 15
Whats next
Whats Next? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30
page 3
introduction
Introduction
EasyAVR is your old friend. It has been here for you for several generations. Today it has many users among students, hobbyists, enthusiasts and professionals. We asked ourselves what else could be done to make such a great board even greater. As a result some brilliant changes have been made. We focused all of our creativity and knowledge on making a revolutionary new design different from any previous version of the board. We have gone through the process of fine tuning the board performance, and used 4-layer PCB to achieve maximum efficiency. We now present you with the new version of EasyAVR - a powerful, well organized board with on-board programmer - ready to be your strong ally in development. EasyAVR development Team
Amazing connectivity
EasyAVR v7 is all about connectivity. Having four different connectors for each port, you can connect accessory boards, sensors and your custom electronics easier then ever before.
mikroProg on board
Powerful on-board mikroProg programmer can program about 65 AVR microcontrollers from Atmel. You will need it, whether you are a professional or a beginner.
mikroBUS support
Just plug in your Click board, and its ready to work. We picked up a set of the most useful pins you need for development and made a pinout standard you will enjoy using.
page 4
EasyAVR
v7
System Specification
- Great choice for both beginners and professionals - Rich with modules - Enough RAM and Flash - Comes with examples for mikroC, mikroBasic and mikroPascal compilers
power supply 712V AC or 915V DC or via USB cable (5V DC) power consumption ~80mA when all peripheral modules are disconnected board dimensions 266 x 220mm (10.47 x 8.66 inch)
Flash program memory, 2K byte of internal SRAM memory and 1K byte of EEPROM memory. It has 40-pin with 32 General purpose I/O pins, 10-bit Analog-to-Digital converter with up to 8 channels (ADC), two 8-bit and one 16-bit timers/counters (with separate prescalers, compare mode and capture mode), four PWM channels, programmable serial USART, Master/slave SPI and two-wire I2C interface, internal calibrated 8 MHz RC and 32 KHz RTC oscillator. It also has JTAG interface for programming/debugging.
Package contains
AD DI T
L NA IO
RE WA FT SO
BA SIC ,M IK RO PA SC AL
CO
PRODUCT DVD
www.mikroe.com www.libstock.com
EXAM PLE S
present you with a comp lete color schem to make electr atics for EasyP onics more understand IC v7 devel most used able, even SMD comp opment board for absolu onents, and . We wante te beginners, what your made additi d board is consis so we provid onal comm ed photos ted of, and ents and drawi of how it actua ngs so you lly works. can get to know
We
S TIC MA HE
USB cable
EasyAVR
v7
IA ED M RO
DS AR BO
Copyright 2012 Mikroelektronika. All rights reserved. MikroElektronika, MikroElektronika logo and other MikroElektronika trademarks are the property of MikroElektronika. All other trademarks are the property of their respective owners. Unauthorised copying, hiring, renting, public performance and broadcasting of this DVD is strictly prohibited.
page 5
introduction
RS LE PI M
S VER DRI
M IK
RD S
SC
power supply
VCC-USB
VCC-5V
FP2
POWER
LD41 R45 2K2
MC33269DT3.3
E6
AVCC
VCC-BRD VCC-5V VCC-3.3V
J5
VCC-5V D1 D2 220uF/35V/LESR R50 10K U5 VINA INH FB GND E ST1S10 PGND SW VINSW SYNC 3 2 1 VCC-USB
1N4007 D4
1 2 3 4
8 7 6 5
L1
10uH R51 4K7 R54 100K R56 20K C34 22uF J22
1N4007
C28 1uF
C29 22uF
E11
C35 22uF
EasyAVR
v7
EasyAVR v7 development board supports both 3.3V and 5V power supply on a single board. This feature enables you to use wide range of peripheral boards.
Power supply:
Power capacity:
via DC connector or screw terminals (7V to 12V AC or 9V to 15V DC), or via USB cable (5V DC) up to 500mA with USB, and up to 1500mA with external power supply
2. Using adapter
Set J22 jumper to EXT position To power the board via adapter connector, place jumper J22 in EXT position, and place jumper J5 in 5V or 3.3V position. You can then plug in the adapter cable as shown on images 3 and 4 , and turn the power switch ON.
EasyAVR
v7
page 7
power supply
supported MCUs
Supported microcontrollers
Microcontroller sockets
The board contains seven DIP sockets: DIP40A, DIP40B, DIP28, DIP20A, DIP20B, DIP14, DIP8 (Figure 4-1). With dual power supply and smart on-board mikroProg, the board is capable of programming about 65 different microcontrollers from Atmel AVR family. There are two DIP40 and DIP20 sockets for AVR microcontrollers provided on the board. Which of these sockets you will use depends solely on the pinout of the microcontroller in use. The EasyAVR v7 development system comes with the ATmega32 microcontroller in a DIP40 package.
DIP40A
PB0 PB1 PB2 PB3 PB4 SCK_MOSI_PB5 MISO_PB6 SCK_PB7 mRST PD0 PD1 PD2 PD3 PD4 PD5 PD6 PD7 CLK 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SKT3 VCC-BRD 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7 PE0 PE1 PE2 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 RST_PA2 PD0 PD1 PA1 CLK_PA0 PD2 PD3 PD4 PD5 VCC-BRD 1 2 3 4 5 6 7 8 9 10
DIP20A
SKT2
VCC-BRD 20 19 18 17 16 15 14 13 12 11 SCK_PB7 MISO_PB6 SCK_MOSI_PB5 PB4 PB3 PB2 PB1 PB0 PD6
DIP20B
MOSI_PB0 MISO_PB1 SCK_PB2 PB3 CLK_PB4 PB5 PB6 RST_PB7 1 2 3 4 5 6 7 8 9 10 SKT5 20 19 18 17 16 15 14 13 12 11
AREF jumper
If you use DIP28 microcontroller socket with jumper J11 you can set PC7 pin either as AVCC or I/O pin. Jumper J11 is placed in the AVCC position by default.
PB0 PB1 PB2 PB3 PB4 SCK_MOSI_PB5 MISO_PB6 SCK_PB7 mRST
VCC-BRD 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
DIP40B
SKT4 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21
DIP8
RST_PB5 CLK_PB3 PB4 1 2 3 4 SKT7 8 7 6 5 SCK_PB2 MISO_PB1 MOSI_PB0
VCC-BRD VCC-BRD VCC-BRD VCC-BRD VCC-BRD VCC-BRD VCC-BRD C13 100nF C14 100nF C15 100nF C16 100nF C17 100nF C18 100nF C19 100nF
DIP SKT 8 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 PD7 AREF SELECTION DIP28 J11 AREF_PC7 PC7 AVCC
CLK_PB6 J13 CLK_PA0 J14 CLK_PB4 J15 CLK_PB0 J16 CLK_PB3 J17
PB6 CLK PA0 CLK PB4 CLK PB0 CLK VCC-BRD C7 100nF C8 22pF CLK 6 U2C 5 R28 1K 8 U2D X1 R23 1M 9
1 U2A
DIP SKT 40B 4 RST_PC6 PD0 PD1 PD2 PD3 PD4 14 13 12 11 10 9 8 PA0 PA1 PA2 PA3 SCK_PA4 MISO_PA5 CLK_PB6 PB7 PD5 PD6 PD7 PB0
VCC-BRD 1 2 3 4 5 6 7 8 9 10 11 12 13 14
DIP28
SKT6 28 27 26 25 24 23 22 21 20 19 18 17 16 15
AVCC PC5 PC4 PC3 PC2 PC1 PC0 AREF_PC7 SCK_MOSI_PB5 MISO_PB4 MOSI_PB3 PB2 PB1
3 U2B
DIP14
SKT1
8MHz
C9 22pF 13
12 U2F
PB3 CLK
EXTERNAL CLOCK
DIP SKT 14
DIP SKT 28
Figure 4-1: Schematic of on-board DIP sockets, quartz-crystal oscillator and decoupling capacitors page 8
EasyAVR
v7
Figure 4-2: Place both ends of microcontroller on the socket so the pins are aligned correctly Before you plug the microcontroller into the appropriate socket, make sure that the power supply is turned off. Images above show how to correctly plug a microcontroller. First make sure that
Figure 4-3: with both fingers, evenly distribute the force and press the chip into the socket. a half circular cut in the microcontroller DIP packaging matches the cut in the DIP socket. Place both ends of the microcontroller into the socket as shown in Figure 4-2. Then put the microcontroller slowly down until
Figure 4-4: Properly placed microcontroller will have equally leveled pins. all the pins match the socket as shown in Figure 4-3. Check again if everything is placed correctly and press the microcontroller until it is completely plugged into the socket as shown in Figure 4-4.
IMPORTANT:
Only one microcontroller may be plugged into the development board at the same time.
AVR microcontrollers can use either built-in (internal) or quartz-crystal external clock for the purpose of providing clock signal source. The EasyAVR v7 contains one quartzcrystal socket for all microcontroller sockets. DIP40A and DIP40B sockets are directly connected to quartz-crystal socket unlike DIP28, DIP20A, DIP20B, DIP14 and DIP8 sockets which are connected to it through the pin jumpers (J13-J17). The value of the
quartz-crystal depends on the maximum clock frequency allowed and your application as well. You can always replace the default 8MHz crystal with another one. If you want to use microcontrollers in DIP40A and DIP40B packages, it is necessary to place jumpers J13-J17 into the I/O position, Figure 4-5.The position of jumpers for DIP28, DIP20A, DIP20B, DIP14 and DIP8 sockets is shown in Figure 4-6 to Figure 4-10.
EasyAVR
v7
page 9
supported MCUs
programming
On-board programmer
What is mikroProg?
mikroProg is a fast USB 2.0 programmer. Smart engineering allows mikroProg to support about 65 AVR microcontrollers from Atmel in a single programmer! Outstanding performance and easy operation are among it's top features.
How do I start?
In order to start using mikroProg and program your microcontroller, you just have to follow two simple steps: 1. Install the necessary software - Install USB drivers - Install AVRFlash software 2. Power up the board, and you are ready to go. - Plug in the programmer USB cable - LINK LED should light up.
NOTE:
Before using the programmer, make sure that reset selection jumpers J6, J7, J8, J9, and J10 are placed into the mRST position for all sockets.
page 10
EasyAVR
v7
VCC-BRD
VCC-5V
LINK
VCC-3.3V
ACTIVE DATA
VCC-BRD VCC-5V VCC-5V VCC-USB FP1 CN1 LED-DATA LED-ACTIVE LED-LINK VCC 1 USB-PROG_N USB-PROG_P USB-PROG_N USB-PROG_P C3 100nF GND VCC-BRD PB5 PB4 PB3 SCK_MOSI_PB5 MISO_PB4 MOSI_PB3 D2
LD2 R8 2K2
LD1 R9 4K7
D+ 3 GND 4 USB
mRST
PC5 R25
TDI CN6
mRST
mRST
mRST
mRST
mRST
PC6
PA2
PB7
PB3
PB5
J6 RST_PC6 RST_PA2
J7 RST_PB7
J8 RST_PB3
J9 RST_PB5
J10 C5 100nF
BTN_RST
DIP28
DIP20A
DIP14
DIP8
EasyAVR
v7
mRST BTN_RST
AVR JTAG
MCU_RST BTN_RST
page 11
programming
DATA BUS
programming
L NA IO
RE WA FT SO
BA SIC ,M IK RO PA SC AL
CO
RS LE PI M
PRODUCT DVD
www.mikroe.com www.libstock.com
EXAM PLE S
S VER DRI
S TIC MA HE
When you locate the drivers, please extract files from the ZIP archive. Folder with extracted files contains sub folders with drivers for different operating systems. Depending on which operating system you use, choose adequate folder and open it.
lab
le on Product
In the opened folder you should be able to locate the driver setup file. Double click on setup file to begin installation of the programmer drivers.
page 12
RD S
ai
D!
IA ED M RO
DS AR BO
Copyright 2012 Mikroelektronika. All rights reserved. MikroElektronika, MikroElektronika logo and other MikroElektronika trademarks are the property of MikroElektronika. All other trademarks are the property of their respective owners. Unauthorised copying, hiring, renting, public performance and broadcasting of this DVD is strictly prohibited.
M IK
SC
DV
Av
EasyAVR
v7
AVRFlash software
On-board mikroProg programmer requires special programming software called AVRFlash. This software is used for programming AVR microcontrollers from Atmel. Software has intuitive interface and SingleClick programming technology. To begin, first locate the installation archive on the Product DVD:
AD DI T
L NA IO
RE WA FT SO
BA SIC ,M IK RO PA SC AL
CO
RS LE PI M
PRODUCT DVD
www.mikroe.com www.libstock.com
EXAM PLE S
DVD://download/eng/software/development-tools/avr/avrprog2/avrprog2_programmer_v214.zip
S TIC MA HE
lab
le on Product
EasyAVR
RD S
ai
D!
IA ED M RO
DS AR BO
Copyright 2012 Mikroelektronika. All rights reserved. MikroElektronika, MikroElektronika logo and other MikroElektronika trademarks are the property of MikroElektronika. All other trademarks are the property of their respective owners. Unauthorised copying, hiring, renting, public performance and broadcasting of this DVD is strictly prohibited.
DV
After downloading, extract the package and double click the executable setup file, to start installation.
page 13
programming
Programming software
S VER DRI
M IK
SC
Av
communication
In order to enable RS-232 communication, you must set J23 and J12 jumpers in the RS232 position, and enable desired RX and TX lines via SW10 DIP switch. For example, if you want to enable RS-232 connection on UART module of the default ATmega32 chip, you should enable SW10.1 (RD0) and SW10.2 (RD1) lines.
DATA BUS
RX-232 RX-FTDI
C11 100nF 2 3 4 C20 100nF 5 6 7 8 C21 100nF
J23
RX TX
TX-232 TX-FTDI
SW10
J12
C22 100nF
TX-232 RX-232
RS-232 CONNECTOR
1 6 2 7 3 8 4 9 5
1 6
N O 1 2 3 4 5 6 7 8
page 14
EasyAVR
v7
Enabling USB-UART
AD DI T
Modern PC computers, laptops and notebooks are no longer equipped with RS-232 connectors and UART controllers. They are nowadays replaced with USB connectors and USB controllers. Still, certain technology enables UART communication to be done via USB connection. FT232RL from FTDI convert UART signals to the appropriate USB standard. In order to use USB-UART module on EasyAVR v7, you must first install FTDI drivers on your computer. Drivers can be found on Product DVD:
L NA IO
RE WA FT SO
BA SIC ,M IK RO PA SC AL
CO
PRODUCT DVD
www.mikroe.com www.libstock.com
EXAM PLE S
USB-UART communication is being done through a FT232RL controller, USB connector (CN4), and microcontroller UART module. To establish this connection, you must put J23 and J12 jumpers in the USB-UART position, and connect RX and TX lines to the appropriate pins of the microcontroller. This connection is done using DIP switch SW10.
lab
le on Product
DATA BUS
RX-232 RX-FTDI
J23
RX TX
N O
RX-FTDI
TX-FTDI
TX-232 TX-FTDI
SW10
J12
1 2 3 4 5 6 7 8 9 10 11 12 13 14
U1 TXD OSCO DTR# OSCI RTS# TEST VCCIO AGND RXD NC CBUS0 RI# GND CBUS1 FT232RL NC GND DSR# VCC DCD# RESET# CTS# GND CBUS4 3V3OUT CBUS2 USBDM CBUS3 USBDP FT232RL
28 27 26 25 24 23 22 21 20 19 18 17 16 15
VCC 1 DD+ 2 3
GND 4 USB B
RX-FTDI TX-FTDI
EasyAVR
v7
RD S
ai
D!
IA ED M RO
DS AR BO
SC
In order to enable USB-UART communication, you must set J23 and J12 jumpers in the USB-UART position, and enable desired RX and TX lines via SW10 DIP switch. For example, if you want to enable USB-UART connection on UART module of the default ATmega32 chip, you should enable SW10.1 (RD0) and SW10.2 (RD1) lines.
DVD://download/eng/software/development-tools/ universal/ftdi/vcp_drivers.zip
S TIC MA HE
Copyright 2012 Mikroelektronika. All rights reserved. MikroElektronika, MikroElektronika logo and other MikroElektronika trademarks are the property of MikroElektronika. All other trademarks are the property of their respective owners. Unauthorised copying, hiring, renting, public performance and broadcasting of this DVD is strictly prohibited.
DV
VCC-BRD
VCC-BRD
VCC-5V
R57 100K
C1 100nF VCC-BRD
C2 100nF
page 15
communication
S VER DRI
M IK
Av
1 2 3 4 5 6 7 8
connectivity
mikroBUS sockets
Easier connectivity and simple configuration are imperative in modern electronic devices. Success of the USB standard comes from its simplicity of usage and high and reliable data transfer rates. As we in mikroElektronika see it, Plug-and-Play devices with minimum settings are the future in embedded world too. This is why our engineers have come up with a simple, but brilliant pinout with lines that most of todays accessory boards require, which almost completely eliminates the need of additional hardware settings. We called this new standard the mikroBUS. EasyAVR v7 is the first development board in the world to support mikroBUS with three on-board sockets. As you can see, there are no additional DIP switches, or jumper selections. Everything is already routed to the most appropriate pins of the microcontroller sockets.
AN - Analog pin RST - Reset pin CS - SPI Chip Select line SCK - SPI Clock line
MISO - SPI Slave Output line MOSI - SPI Slave Input line +3.3V - VCC-3.3V power line GND - Reference Ground
PWM - PWM output line INT - Interrupt line RX - UART Receive line TX - UART Transmit line
SCL - I2C Clock line SDA - I2C Data line +5V - VCC-5V power line GND - Reference Ground
DIP20B
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
SW5
SW3
SW6
EasyAVR
v7
GSM2 click
GPS2 click
RELAY click
THERMO click
mikroElektronika portfolio of over 200 accessory boards is now enriched by an additional set of mikroBUS compatible Click Boards. Almost each month several new Click boards are released. It is our intention to provide the community with as much of these boards as possible, so you will be able to expand your EasyAVR v7 with additional functionality with literally zero hardware configuration. Just plug and play. Visit the Click boards webpage for the complete list of available boards: http://www.mikroe.com/click/
LightHz click
microSD click
DAC click
DIGIPOT click
IR click
page 17
EasyAVR
v7
connectivity
connectivity
Input/Output Group
One of the most distinctive features of EasyAVR v7 are its Input/Output PORT groups. They add so much to the connectivity potential of the board.
Figure 9-1: I/O group contains PORT headers, tri-state pull up/down DIP switch, buttons and LEDs all in one place
DATA BUS
PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
4k7
+1 2 3 4 5 6 7 8
UP PULL DOWN
VCC-BRD
SW4
1 2 3 4 5 6 7 8 9 10
CN11
N O 1 2 3 4 5
RN17 10K
RN18 10K
RN19 10K
RN20 10K
RN21 10K
RN22 10K
RN23 10K
RN24 10K
PORTB_LED VCC-BRD J1
_ +1 2 3 4 5 6 7 8
PB2
PB5
VCC GND
J2
SW10
PB5 PB4 PB3 PB7
PB7
PB6
PB4
PB3
PB1
T10
PB6
T11
T12
T13
T14
PB2
T15
T16
PB0
PB1
PB0
6 7 8
LD14
LD15
LD16
LD17
LD18
LD19
LD20
LD21
T17
R13 220
Figure 9-3: Schematic of the single I/O group connected to microcontroller PORTB page 18
EasyAVR
v7
Headers Buttons
With enhanced connectivity as one of the key features of EasyAVR v7, we have provided three connection headers for each PORT. I/O PORT group contains two male IDC10 headers (like CN9 and CN10 on Figure 9-3). These headers are all compatible with over 70 mikroElektronika accessory boards, and enable simple connection. There is one more IDC10 header available on the left side of the board, next to the section with displays. I/O PORT group also contains 1x10 connection pad (like CN11 on Figure 9-3) which can be used for connecting mikroElektronika PROTO boards, or custom user boards. The logic state of all microcontroller digital inputs may be changed using push Figure 9-5: Button press buttons. Tri-state level DIP switch (tri-state) DIP switch SW1 is available for selecting which logic state will be applied to corresponding MCU pin when button is pressed, for each I/O port separately. If you, for example, place SW1.2 in VCC position, then pressing any of push buttons in PORTB I/O group will apply logic one to the appropriate microcontroller pin. The same goes for GND. If DIP switch is in the middle position neither of two logic states will be applied to the appropriate microcontroller pin. You can disable pin protection 220ohm resistors by placing jumpers J1 and J2, which will connect your push buttons directly to VCC or GND. Be aware that doing so you may accidentally damage MCU in case of wrong usage.
LEDs
LED (Light-Emitting Diode) is a highly PA0 PA1 efficient electronic PA2 light source. When PA3 connecting LEDs, it Microcontroller is necessary to place SMD resistor a current limiting limiting current resistor in series through the LED so that LEDs are provided with the current value specified by the manufacturer. The current varies from 0.2mA to 20mA, depending on the type of the LED and the manufacturer.. The EasyAVR v7 board uses low-current LEDs with typical current consumption of 0.2mA or 0.3mA, depending of VCC voltage selection. Board contains 35 LEDs which can be used for visual indication of the logic state on PORT pins. An active LED indicates that a logic high (1) is present on the pin. In order to enable PORT LEDs, it is necessary to enable Figure 9-6: SW10.5 the corresponding DIP through SW10.8 switches on SW10 (Figure switches are used to 9-6). enable PORT LEDs page 19
Reset Button
In the far upper right section of the board, there is a RESET button, which can be used to manually reset the microcontroller.
Figure 9-4: IDC10 male headers enable easy connection with mikroElektronika accessory boards
EasyAVR
v7
connectivity
displays
IMPORTANT: Make sure to turn off the power supply before placing LCD onto
the board. Otherwise your display can be permanently damaged.
BCK LIGHT BCK PWM VCC-5V
N O 1
P2
VCC-5V
PD5
2 3 4 5 6 7 8
SW3
VCC-5V
56
DATA BUS
GND
GND
IMPORTANT: In order to use PWM back-light both SW3.1 and SW3.2 switches must
be enabled at the same time.
page 20
EasyAVR
v7
Graphical Liquid Crystal Displays, or GLCDs are used to display monochromatic graphical content, such as text, images, humanmachine interfaces and other content. EasyAVR v7 provides the connector and necessary interface for supporting GLCD with resolution of 128x64 pixels, driven by the KS108 or compatible display controller. Communication with the display module is done through CN16 display connector. Board is fitted with uniquely designed plastic display distancer, which allows the GLCD module to perfectly and firmly fit into place.
Display connector is routed to PB0, PB1, PA2, PA3, PD6, PD7 (control lines) and PORTC (data lines) of the microcontroller sockets. Since the same ports are used by 2x16 character LCD display, you cannot use both displays simultaneously. You can control the display contrast using dedicated potentiometer P4. Full brightness display back light can be enabled with SW3.1 switch, and PWM-driven back light with SW3.2 switch.
DATA BUS
Figure 11-1: GLCD 128x64 connection schematic
P4 BCK LIGHT BCK PWM SW3
N O 1 2
VCC-5V PD5
10K
PA2 PA3 PD6 PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 PD7
PB0 PB1
VCC-5V
CS1 and CS2 - Controller Chip Select lines VCC - +5V display power supply GND - Reference ground Vo - GLCD contrast level from potentiometer P4 RS - Data (High), Instruction (Low) selection line R/W - Determines whether display is in Read or Write mode.
E - Display Enable line D0D7 - Data lines RST - Display reset line Vee - Reference voltage for GLCD contrast potentiometer P3 LED+ - Connection with the back-light LED anode LED- - Connection with the back-light LED cathode
20
IMPORTANT: In order to use PWM back-light both SW3.1 and SW3.2 switches must
be enabled at the same time.
EasyAVR
v7
page 21
displays
3 4 5 6 7 8
GLCD 128x64
displays
1
Figure 12-1: Put Touch panel flat cable in the connector
BOTTOM LEFT CN16 GLCD-TFT SOCKET2 1
CS1 CS2 GND Vcc Vo RS R/W E D0 D1 D2 D3 D4 D5 D6 D7 RST Vee LED+ LED-
2
Figure 12-2: Use a tip of your finger to push it inside
3
Figure 12-3: Now place GLCD with Touch panel into GLCD socket
VCC-BRD
20 Q6 BC856 R40 10K RIGHT VCC-BRD Q9 BC856 R44 10K TOP Q13 BC846 R41 10K VCC-BRD R43 1K DRIVEA R38 1K
CN20
VCC-BRD
21 22 23 24
E7 10uF
VCC-BRD BOTTOM C33 100nF Q11 BC846 R55 100K R53 10K R52 1K DRIVEB
DATA BUS
Figure 12-5: Turn on switches 5 through 8 on SW8 to enable Touch panel controller
N O 1 2 3 4 5 6 7 8
EasyAVR
v7
Figure 13-1: Turn on switches 1 through 4 on SW8 to enable 4-digit 7-seg display
COM3
10 9 8 7 6
g f cc a b
g f cc a b
g f cc a b
g f cc a b
10 9 8 7 6
10 9 8 7 6
10 9 8 7 6
Q1 BC846
COM0
c dp c dp c dp c dp
DIS0
R1 R2 R3 R4 R5 R6 R7 R11
e d
e d
e d
e d
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
SEG C SEG DP
SEG C SEG DP
SEG C SEG DP
SEG C SEG DP
SEG E SEG D
SEG E SEG D
SEG E SEG D
SEG E SEG D
1 2 3 4 5
N O
DATA BUS
Figure 13-2: 4-digit 7-segment display schematic
EasyAVR
v7
page 23
displays
1 2 3 4 5 6 7 8
modules
VCC-BRD
C12 100nF
VCC-BRD
R31 1K
DQ
DQ VCC
EasyAVR v7 enables you to establish 1-wire communication between DS1820 and the microcontroller via PB4 or PA7 microcontroller pins. The selection of either of those two lines is done using J18 jumper. When placing the sensor in the socket make sure that half-circle on the boards silkscreen markings matches the rounded part of the DS1820 sensor. If you accidentally connect the sensor the other way, it may be permanently damaged. Make sure to disconnect other peripherals (except 1-wire), LEDs and additional pull-up or pull-down resistors from the interface lines in order not to interfere with signal/data integrity.
J18
PA7 PB4
page 24
EasyAVR
DATA BUS
v7
GND
DATA BUS
EasyAVR v7 enables you to get analog readings from the LM35 sensor using PA7 or PB4 microcontroller pins. The selection of either of those two lines is done using J19 jumper. When placing the sensor in the socket make sure that half-circle on the boards silkscreen markings matches the rounded part of the LM35 sensor. If you accidentally connect the sensor the other way, it can be permanently damaged and you might need to replace it with another one. During the readings of the sensor, make sure that no other device uses the selected analog line, because it may interfere with the readings.
C23 100nF
VOUT
J19
PB4 PA7
Figure 15-5: LM35 connected to PA7 pin page 25
EasyAVR
v7
modules
100
R33
modules
ADC inputs
Digital signals have two discrete states, which are decoded as high and low, and interpreted as logic 1 and logic 0. Analog signals, on the other hand, are continuous, and can have any value within defined range. A/D converters are specialized circuits which can convert analog signals (voltages) into a digital representation, usually in form of an integer number. The value of this number is linearly dependent on the input voltage value. Most microcontrollers nowadays internally have A/D converters connected to one or more input pins. Some of the most important parameters of A/D converters are conversion time and resolution. Conversion time determines how fast can an analog voltage be represented in form of a digital number. This is an important parameter if you need fast data acquisition. The other parameter is resolution. Resolution represents the number of discrete steps that supported voltage range can be divided into. It determines the sensitivity of the A/D converter. Resolution is represented in maximum number of bits that resulting number occupies. Most AVR microcontrollers have 10-bit resolution, meaning that maximum value of conversion can be represented with 10 bits, which converted to integer is 210=1024. This means that supported voltage range, for example from 0-5V, can be divided into 1024 discrete steps of about 4.88mV. EasyAVR v7 provides an interface in form of two potentiometers for simulating analog input voltages that can be routed to any of the 12 supported analog input pins.
VCC-BRD
DATA BUS
Figure 16-2: Schematic of ADC input
P1 R17 220
Figure 16-1: use J3 and J4 jumpers to connect analog input lines In order to connect the output of the potentiometer P1 to PB0, PB2, PD6, PB4, PB5 or PC3 analog microcontroller inputs, you have to place the jumper J3 in the desired position. If you want to connect potentiometer P3 to any of the PB1, PB3, PD7, PC4, PA5 or PA6 analog microcontroller inputs, place jumper J4 in the desired position. By moving the potentiometer knob, you can create voltages in range from GND to VCC-BRD.
J3
PB1 PB3 PD7 PC4 PA5 PA6
C4 100nF
10K VCC-BRD
J4
C10 100nF
page 26
EasyAVR
v7
EEPROM is short for Electrically Erasable Programmable Read Only Memory. It is usually a secondary storage memory in devices containing data that is retained even if the device looses power supply. Because of the ability to alter single bytes of data, EEPROM devices are used to store personal preference and configuration data in a wide spectrum of consumer, automotive, telecommunication, medical, industrial, and PC applications. EasyAVR v7 supports serial EEPROM which uses I2C communication interface and has 1024 bytes of available memory. Board contains socket for serial EEPROMs in DIP8 packaging, so you can easily exchange it with different memory size EEPROM IC. EEPROM itself supports single byte or 16-byte (page) write and read operations. Data rate is 400 kHz for both 3.3V and 5V power supply.
In order to connect I2C EEPROM to the microcontroller you must enable SW5.7 and SW5.8 as well as appropriate SW6 switches depending on socket you want to use, as shown on Figure 17-1. 1k pull-up resistors necessary for I2C communication are already provided on SDA and SCL lines once switches are turned on. Prior to using EEPROM in your application, make sure to disconnect other peripherals, LEDs and additional pull-up or pull-down resistors from the interface lines in order not to interfere with signal/data integrity.
What is I2C?
I2C is a multi-master serial single-ended bus that is used to attach low-speed peripherals to computer or embedded systems. IC uses only two open-drain lines, Serial Data Line (SDA) and Serial Clock (SCL), pulled up with resistors. SCL line is driven by a master, while SDA is used as bidirectional line either by master or slave device. Up to 112 slave devices can be connected to the same bus. Each slave must have a unique address.
DATA BUS
VCC-BRD VCC-BRD U4 A0 A1 A2 VSS 24C08 VCC WP SCL SDA VCC-BRD C25 100nF
1 2 3 4
8 7 6 5
R48 1K
SCL SDA
SW6
N O
N O
SW5
EasyAVR
v7
I2C SELECTION
DIP20B
Figure 17-1: Schematic of I2C EEPROM module connected to DIP40B socket pins
page 27
modules
1
I C EEPROM
2
1 2 3 4 5 6 7 8
2 3 4 5 6 7 8
modules
Piezo Buzzer
Piezo electricity is the charge which accumulates in certain solid materials in response to mechanical pressure, but also providing the charge to the piezoelectric material causes it to physically deform. One of the most widely used applications of piezo electricity is the production of sound generators, called piezo buzzers. Piezo buzzer is an electric component that comes in different shapes and sizes, which can be used to create sound waves when provided with analog electrical signal. EasyAVR v7 comes with piezo buzzer which can be connected either to PB1 or PD4 microcontroller pins, which is determined by the position of J21 jumper. Buzzer is driven by transistor Q8 (Figure 18-1). Microcontrollers can create sound by generating a PWM (Pulse Width Modulated) signal a square wave signal, which is nothing more than
VCC-5V
TOP VIEW
a sequence of logic zeros and ones. Frequency of the square signal determines the pitch of the generated sound, and duty cycle of the signal can be used to increase or decrease the volume in the range from 0% to 100% of the duty cycle. You can generate PWM signal using hardware capture-compare module, which is usually available in most microcontrollers, or by writing a custom software which emulates the desired signal waveform.
DATA BUS
Figure 18-1: Piezo buzzer connected to TOP PB1 microcontroller pin VIEW
PZ1 TOP VIEW PERSPECTIVE VCC-5V VIEW PZ1 TOP 50% Freq = 3kHz, VIEW VIEW PZ1 VCC-5V
PB1 PD4
R39 1K
PZ1 BUZZER
PERSPECTIVE VIEW
VCC-5V
R3 1K
J21
10K
R3 R27 1K
J21
50% PERSPECTIVEVolume = Q8
BC846
RC2
Freq = 3kHz, RE1 80% 10K to the buzzer driver. The pitch of the PERSPECTIVEVolume = Q8 J21 by the frequency, sound is determined VIEW BC846 RC2 R27 and amplitude is determined by the BUZZER Freq = 3kHz, Duty Cycle = 20% Freq = 3kHz, duty cycle of the PWM signal. RE1 Volume = 20% 10K Q8
BC846
J21 R3 Buzzer starts "singing" when you provide RC2 1K R27 PWM BUZZER signal from the microcontroller
BUZZER
R42
Q8 BC846
page 28
EasyAVR
v7
EasyAVR v7 contains three GND pins located in three different sections of the board, which allow you to easily connect oscilloscope GND reference when you monitor signals on microcontroller pins, or signals of on-board modules.
1 1
Figure 19-1: 3 oscilloscope GND pins are conveniently positioned so each part of the board can be reached with an oscilloscope probe
EasyAVR
v7
page 29
modules
Additional GNDs
whats next?
Whats Next?
You have now completed the journey through each and every feature of EasyAVR v7 board. You got to know its modules, organization, supported microcontrollers, programmer. Now you are ready to start using your new board. We are suggesting several steps which are probably the best way to begin. We invite you to join thousands of users of EasyAVR brand. You will find very useful projects and tutorials and can get help from a large ecosystem of users. Welcome!
Compiler
You still dont have an appropriate compiler? Locate AVR compiler that suits you best on the Product DVD provided with the package:
DVD://download/eng/software/compilers/
MIK ROC ILERS , MI COMP KRO
Choose between mikroC, mikroBasic and mikroPascal and download fully functional demo version, so you can begin building your AVR applications.
AD DI T
L NA IO
RE WA FT SO
BA SIC ,M IK RO PA SC AL
CO
RS LE PI M
PRODUCT DVD
www.mikroe.com www.libstock.com
EXAM PLE S
S VER DRI
S TIC MA HE
lab
Projects
Once you have chosen your compiler, and since you already got the board, you are ready to start writing your first projects. We have equipped our compilers with dozens of examples that demonstrate the use of each and every feature of the EasyAVR V7 board, and all of our accessory boards as well. This makes an excellent starting point for your future projects. Just load the example, read well commented code, and see how it works on hardware. Browse through the compiler Examples path to find the following folder:
\Development Systems\
Community
If you want to find answers to your questions on many interesting topics we invite you to visit our forum at http://www.mikroe.com/forum and browse through more than 150 thousand posts. You are likely to find just the right information for you. On the other hand, if you want to download free projects and libraries, or share your own code, please visit the Libstock website. With user profiles, you can get to know other programmers, and subscribe to receive notifications on their code.
http://www.libstock.com/
Support
le on Product
We all know how important it is that we can rely on someone in moments when we are stuck with our projects, facing a deadline, or when we just want to ask a simple, basic question, thats pulling us back for a while. We do understand how important this is to people and therefore our Support Department is one of the pillars upon which our company is based. MikroElektronika offers Free Tech Support to the end of product lifetime, so if something goes wrong, we are ready and willing to help!
http://www.mikroe.com/esupport/
page 30
EasyAVR
RD S
ai
D!
DV
v7
IA ED M RO
DS AR BO
Copyright 2012 Mikroelektronika. All rights reserved. MikroElektronika, MikroElektronika logo and other MikroElektronika trademarks are the property of MikroElektronika. All other trademarks are the property of their respective owners. Unauthorised copying, hiring, renting, public performance and broadcasting of this DVD is strictly prohibited.
M IK
SC
Av
DISCLAIMER
All the products owned by MikroElektronika are protected by copyright law and international copyright treaty. Therefore, this manual is to be treated as any other copyright material. No part of this manual, including product and software described herein, must be reproduced, stored in a retrieval system, translated or transmitted in any form or by any means, without the prior written permission of MikroElektronika. The manual PDF edition can be printed for private or local use, but not for distribution. Any modification of this manual is prohibited. MikroElektronika provides this manual as is without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties or conditions of merchantability or fitness for a particular purpose. MikroElektronika shall assume no responsibility or liability for any errors, omissions and inaccuracies that may appear in this manual. In no event shall MikroElektronika, its directors, officers, employees or distributors be liable for any indirect, specific, incidental or consequential damages (including damages for loss of business profits and business information, business interruption or any other pecuniary loss) arising out of the use of this manual or product, even if MikroElektronika has been advised of the possibility of such damages. MikroElektronika reserves the right to change information contained in this manual at any time without prior notice, if necessary.
TRADEMARKS
The MikroElektronika name and logo, the MikroElektronika logo, mikroC, mikroBasic, mikroPascal, mikroProg, EasyAVR, READY, mikroBus, mikromedia, MINI and Click boards are trademarks of MikroElektronika. All other trademarks mentioned herein are property of their respective companies. All other product and corporate names appearing in this manual may or may not be registered trademarks or copyrights of their respective companies, and are only used for identification or explanation and to the owners benefit, with no intent to infringe.
If you want to learn more about our products, please visit our website at www.mikroe.com If you are experiencing some problems with any of our products or just need additional information, please place your ticket at www.mikroe.com/esupport If you have any questions, comments or business proposals, do not hesitate to contact us at office@mikroe.com
0 100000 023297
Mouser Electronics
Authorized Distributor
mikroElektronika:
MIKROE-1385