USER'S GUIDE

USER'S GUIDE

Easy AVR v7

65 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

To our valued customers

Making the best and the most comprehensive AVR® board in the world was our idea from the start. And this is by no means an easy task. Driven by passion for excellence we never look at how hard the job is, but what our users get when it's done. And EasyAVR® v7 brings a whole new perspective to AVR developers.

The 7th generation of the board brings many exciting new features. We hope that you will like it as much as we do.

Use it wisely and have fun!

Nebojsa Matic,

Owner and General Manager of mikroElektronika

Introduction

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

04

It's good to know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

05

Power Supply

Dual power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

06

Supported MCUs

Supported microcontrollers . . . . . . . . . . . . . . . . . . . . . . . .

08

Programming

On-board programmer . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

Installing programmer drivers . . . . . . . . . . . . . . . . . . . . . .

12

Programming software . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13

Communication

UART via RS-232 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

UART via USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14

15

Connectivity

mikroBUS

sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Input/Output Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16

18

Displays

LCD 2x16 characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

GLCD 128x64. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

21

Touch panel controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 digit 7-seg display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

22

23

Modules

DS1820 - Digital Temperature Sensor . . . . . . . . . . . . . .

24

LM35 - Analog Temperature Sensor . . . . . . . . . . . . . . . .

ADC inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

25

26

I2C EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27

Piezo Buzzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

Additional GNDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29

What’s next

What’s Next? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

page 3

page 4

Four Connectors for each port

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.

Everything is already here

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.

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

3.3V and 5V power supply

Dual Power Supply

EasyAVR

v7 is among few development boards which support both 3.3V and 5V microcontrollers. This feature greatly increases the number of supported MCUs. It’s like having two boards instead of one!

For easier connections

mikroBUS

support

Just plug in your Click

board, and it’s 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.

Easy AVR v7

It's good to know

ATmega32 is the default microcontroller!

Atmel® AVR® 8-bit ATmega32 in DIP is the default chip of

EasyAVR

v7. It has up to

16 MIPS

operation,

32K bytes

of

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

I

2

C

interface, internal calibrated 8 MHz RC and 32 KHz RTC oscillator. It also has

JTAG interface for programming/debugging.

- Great choice for both beginners and professionals

- Rich with modules

- Enough RAM and Flash

- Comes with examples for mikroC, mikroBasic and mikroPascal compilers

System Specification

power supply

7–12V AC or 9–15V 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)

weight

~438g (0.966 lbs)

Package contains

1

Damage resistant protective box

Easy AVR v7

2

EasyAVR

v7 board in antistatic bag

3

USB cable

4

We present you with a complete color schema what your board is c ts, and made additional development board. We comments and drawings wanted so you can get to kno of w

User Manuals and

Board schematic

EX

AM

PL

COMPI

LERS • • • • • • • • • MIKRO

C, MIKR

ES

AD

DI

TI

ON

AL

SO

FT

WA

RE

• •

• • www.mikroe.com

www.libstock.com

OBAS

IC, M

IKRO

PAS

CAL

CO

MP

ILE

PRODUCT DVD

RS

• •

• •

• •

DR

IV

ER

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.

and broadcasting of this DVD is strictly prohibited.

S UAL

MAN

5

DVD with examples and documentation

page 5

page 6

Dual power supply

Board contains switching power supply that creates stable voltage and current levels necessary for powering each part of the board. Power supply section contains two power regulators:

ST1S10, which generates

VCC-5V, and MC33269DT3.3 which creates VCC-3.3V power supply. The board can be powered in three different ways: with USB

power supply (CN1), using external adapters via adapter connector (CN24) or additional screw terminals (CN25). External adapter voltage levels must be in range of 9-15V DC or 7-12V AC. Use jumper J22 to specify which power source you are using and jumper J5 to specify whether you are using 5V or 3.3V power supply. Upon providing the power using either external adapter or USB power source you can turn on power supply by using SWITCH 1 (Figure

3-1). Power LED (Green ON) will indicate the presence of power supply.

Figure 3-1: Dual power supply unit of EasyAVR

v7

VCC-USB

FP1

VCC 1

2

C3

100nF

GND

3

4

CN1

USB

CN25

CN24

VCC-BRD

FP2

AVCC

VCC-5V

R45

2K2

POWER

LD41

VCC-5V

E9

10uF

C27

100nF

1

3

REG1

GND

Vout

Vin

MC33269DT3.3

2

C26

100nF

VCC-3.3V

E8

10uF

AVCC

VCC-BRD

VCC-5V

J5

VCC-3.3V

D1

1N4007

D3

1N4007

D2

1N4007

D4

1N4007

R50

10K

3

4

1

2

U5

VINA

INH

FB

GND

ST1S10

PGND

SW

VINSW

SYNC

8

7

6

5

C28

1uF

5V SWITCHING POWER SUPPLY

3.3V VOLTAGE REGULATOR

L1 10uH

C29

22uF

R51

4K7

R54

100K

R56

20K

J22

C34

22uF

C35

22uF

SWITCH1

VCC-5V

VCC-USB

Figure 3-2: Dual power supply unit schematic

Easy AVR 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: via DC connector or screw terminals

(7V to 12V AC or 9V to 15V DC),

or via USB cable (5V DC)

Power capacity: up to 500mA with USB, and up to 1500mA

with external power supply

How to power the board?

1. With USB cable

Set J22 jumper to USB position

To power the board with USB cable, place jumper J22 in

USB position and place jumper J5 in 5V or 3.3V position.

You can then plug in the USB cable as shown on images

1

and

2

, and turn the power switch ON.

1 2

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.

3. With laboratory power supply

Set J22 jumper to EXT position

To power the board using screw terminals, place jumper

J22 in EXT position, and place jumper J5 in 5V or 3.3V position. You can then screw-on the cables in the screw terminals as shown on images

5

and

6

, and turn the power switch ON.

Easy AVR v7

3

5

4

6

page 7

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.

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.

VCC-BRD VCC-BRD VCC-BRD

E3

10uF

E4

10uF

E5

10uF

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

CLK_PB6

CLK_PA0

J13

J14

CLK_PB4

J15

CLK_PB0

J16

CLK_PB3

J17

PB0

CLK

PB3

CLK

PB6

CLK

PA0

CLK

PB4

CLK

CLK 6

U2C

VCC-BRD

C7

100nF

C8

22pF

5

R28

1K

8

U2D

X1

R23

1M

9

8MHz

C9

22pF

EXTERNAL CLOCK

1

U2A

2

3

U2B

4

11

U2E

10

13

U2F

12

PD0

PD1

PD2

PD3

PD4

PD5

PD6

PD7

PB0

PB1

PB2

PB3

PB4

SCK_MOSI_PB5

MISO_PB6

SCK_PB7 mRST

CLK

13

14

15

16

9

10

11

12

17

18

19

20

7

8

5

6

3

4

1

2

SKT3

DIP40A

DIP SKT 40A

VCC-BRD

SKT4

DIP40B

CLK

PD0

PD1

PD2

PD3

PD4

PD5

PD6

PB0

PB1

PB2

PB3

PB4

SCK_MOSI_PB5

MISO_PB6

SCK_PB7 mRST

13

14

15

16

9

10

11

12

17

18

19

20

7

8

5

6

3

4

1

2

DIP SKT 40B

CLK_PB0

PB1

RST_PB3

PB2

PA7

MOSI_PA6

VCC-BRD

DIP14

SKT1

5

6

7

3

4

1

2

DIP SKT 14

14

13

12

9

8

11

10

VCC-BRD

36

35

34

33

32

31

30

29

40

39

38

37

28

27

26

25

24

23

22

21

36

35

34

33

32

31

30

29

40

39

38

37

28

27

26

25

24

23

22

21

AVCC

PA0

PA1

PA2

PA3

SCK_PA4

MISO_PA5

PA0

PA1

PA2

PA3

PA4

PA5

PA6

PA7

PA0

PA1

PA2

PA3

PA4

PA5

PA6

PA7

PE0

PE1

PE2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PD7

RST_PA2

PD0

PD1

PA1

CLK_PA0

PD2

PD3

PD4

PD5

MOSI_PB0

MISO_PB1

SCK_PB2

PB3

CLK_PB4

PB5

PB6

RST_PB7

RST_PB5

CLK_PB3

PB4

VCC-BRD

9

10

7

8

5

6

3

4

1

2

9

10

7

8

5

6

3

4

1

2

DIP20A

SKT2

20

19

18

17

16

15

14

13

12

11

VCC-BRD

SCK_PB7

MISO_PB6

SCK_MOSI_PB5

PB4

PB3

PB2

PB1

PB0

PD6

DIP SKT 20A

DIP20B

SKT5

20

19

18

17

16

15

14

13

12

11

AVCC

PA0

PA1

PA2

PA3

PA4

PA5

PA6

PA7

3

4

1

2

DIP SKT 20B

DIP8

SKT7

8

7

6

5

DIP SKT 8

SCK_PB2

MISO_PB1

MOSI_PB0

AREF_PC7

RST_PC6

PD0

PD1

PD2

PD3

PD4

CLK_PB6

PB7

PD5

PD6

PD7

PB0

AREF SELECTION

DIP28

J11

PC7

AVCC

VCC-BRD

DIP28

SKT6

9

10

11

12

13

14

7

8

5

6

3

4

1

2

DIP SKT 28

28

27

26

25

24

23

22

21

20

19

18

17

16

15

AVCC

AREF_PC7

SCK_MOSI_PB5

MISO_PB4

MOSI_PB3

PB2

PB1

PC5

PC4

PC3

PC2

PC1

PC0

Figure 4-1: Schematic of on-board DIP sockets, quartz-crystal oscillator and decoupling capacitors

page 8

Easy AVR v7

How to properly place your microcontroller into the DIP socket?

1 2 3

Figure 4-2: Place both ends of microcontroller on the socket so the pins are aligned correctly

Figure 4-3: with both fingers, evenly distribute the force and press the chip into the socket.

Figure 4-4: Properly placed microcontroller will have equally leveled pins.

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 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 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.

Using external clock

Figure 4-5: Position of the jumpers for DIP40x

Figure 4-6: Position of the jumpers for DIP28

Figure 4-7: Position of the jumpers for DIP20A

Figure 4-8: Position of the jumpers for DIP20B

Figure 4-9: Position of the jumpers for DIP14

Figure 4-10: Position of the jumpers for DIP8

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.

Easy AVR v7

page 9

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.

Programming with JTAGICE mkll programmer

EasyAVR

v7 is equipped with JTAG connector compatible with Atmel® AVR®

JTAGICE mkII external programmer. You can use either the on-board mikroProg

™ programmer or external programmer at the time. Place your programmer cable onto connector CN6, as shown in image.

page 10

Why so many LEDs?

Three LEDs indicate specific programmer operation. Link LED lights up when USB link is established with your PC, Active LED lights up when the programmer is active. Data is on when data is being transferred between the programmer and

PC software (compiler or AVRFlash).

RESET or I/O?

Reset selection jumpers J6, J7, J8, J9, and J10 are used to set PC6, PA2, PB7, PB3 or PB5 pin either as RST or I/O pin, respectively. Each of the pins belongs to different socket. For example, if you want to use PC6 pin (DIP28 socket) as I/O pin place jumper into the PC6 position. Other jumpers must be in RST position. For DIP40A and DIP40B sockets, all the reset selection jumpers must be in RST position.

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.

Easy AVR v7

LINK ACTIVE DATA

VCC-3.3V

VCC-5V

LD2

R8

2K2

LD1

R9

4K7

LD3

R10

6K8

LED-DATA

LED-ACTIVE

LED-LINK

LED-DATA

LED-ACTIVE

LED-LINK

PC2

PC4

PC3

R20

R22

R24

PC5 R25

VCC-BRD

TCK

TDO

TMS

TDI

CN6

AVR JTAG

mRST

VCC-BRD VCC-5V

USB-PROG_N

USB-PROG_P

GND

VCC-USB

FP1

USB-PROG_N

USB-PROG_P

C3

100nF

VCC 1

D2

D+

3

GND 4

CN1

USB

J6 J7 J8 J9 J10

T9

DIP28 DIP20A DIP20B

RESET SELECTION

DIP14 DIP8

Figure 5-1: mikroProg

block schematic

Easy AVR v7

VCC-5V

R21

10K

C5

100nF

BTN_RST

page 11

Installing programmer drivers

On-board mikroProg

requires drivers in order to work.

Drivers are located on the

Product DVD

that you received with the EasyAVR

v7 package:

EX

AM

PL

ES

AD

DI

TI

ON

AL

SO

FT

WA

RE

• •

• •

LERS • • • • • • • • • MIKRO

C, MIKR

OBAS

IC, M

IKRO

PAS

CAL

CO

PRODUCT DVD

www.mikroe.com

www.libstock.com

RS

• •

• •

• •

DR

IV

ER

DVD://download/eng/software/ development-tools/avr/avrprog2/ avrprog2_drivers_v200.zip

Ava

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.

S

UAL

MAN ilable

on Produc t D

VD

!

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.

Step 1 - Start Installation

Welcome screen of the installation. Just click on

Next

button to proceed.

Step 2 - Accept EULA

Carefully read

E

nd

U

ser

L

icense

A

greement. If you agree with it, click

Next

to proceed.

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

Step 3 - Installing drivers Step 4 - Finish installation

Drivers are installed automatically in a matter of seconds.

You will be informed if the drivers are installed correctly.

Click on

Finish

button to end installation process.

Easy AVR v7

Programming software

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.

EX

AM

PL

AD

DI

TI

ON

AL

SO

FT

ES

WA

RE

• •

• •

• •

• •

COMPI

LERS

• • • • • • • • • MIKRO

C, MIKR

IC, M

IKRO

PAS

CAL

CO

MP

ILE

RS

PRODUCT DVD

• •

• •

• •

DR

IV

ER

To begin, first locate the installation archive on the Product DVD:

DVD://download/eng/software/development-tools/avr/avrprog2/avrprog2_programmer_v214.zip

Ava

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.

S

UAL

MAN ilable

on Produc t D

VD

!

After downloading, extract the package and double click the executable setup file, to start installation.

Installation wizard - 6 simple steps

Step 1 - Start Installation Step 2 - Accept EULA and continue

Step 3 - Click

Next

button Step 4 - Choose destination folder

Step 5 - Installation in progress Step 6 - Finish Installation

page 13

Easy AVR v7

UART via RS-232

Enabling RS-232

In order to enable RS-232 communication, you must set

J23 and J12 jumpers in the RS-

232 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

J23

RX

TX

TX-232

TX-FTDI

J12

TX-232

RX-232

SW10

The

UART (universal asynchronous receiver/transmitter) is one of the most common ways of exchanging data between the MCU and peripheral components. It is a serial protocol with separate transmit and receive lines, and can be used for full-duplex communication. Both sides must be initialized with the same baud rate, otherwise the data will not be received correctly.

RS-232 serial communication is performed through a

9-pin SUB-D connector and the microcontroller UART module. In order to enable this communication, it is necessary to establish a connection between

RX and TX lines on SUB-D connector and the same pins on the target microcontroller using

DIP switches. Since RS-232 communication voltage levels are different than microcontroller logic levels, it is necessary to use a RS-232

Transceiver circuit, such as

MAX3232 as shown on Figure 6-1.

PD0

PD1

PD2

PD3

C11

100nF

C20

100nF

C21

100nF

VCC-BRD VCC-BRD

1

U3

C1+ VCC

2

V+ GND

3

C1T1OUT

4

C2+ R1IN

5

C2C2R1OUT

6

V-

V-

T1IN

7

T2OUT T2IN

8

R2IN R2OUT

C22

100nF

MAX3232

VCC-BRD

R35

100K

16

15

14

13

12

11

10

9

E2

10uF

1

6

2

7

3

8

4

9

5

CN12

DB-9

Figure 6-1: RS-232 connection schematic

page 14

Easy AVR v7

UART via USB

Enabling USB-UART

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.

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

EX

AM

PL

ES

DI

TI

AL

ON

SO

FT

WA

RE

• •

• •

• •

• •

COMPI

LERS • • • • • • • • • MIKRO

C, MIKR

OBAS

IC, M

IKRO

PAS

CAL

CO

PRODUCT DVD

MP

ILE

RS www.mikroe.com

www.libstock.com

• •

• •

• •

DR

ER

IV first install FTDI drivers on your computer. Drivers can be found on

Product DVD

:

DVD://download/eng/software/development-tools/ universal/ftdi/vcp_drivers.zip

Ava Copyright ©2012 Mikroelektronika.

All rights reserved. MikroElektronika, MikroElektronika logo and other

All other trademarks are the property of their respective owners.

Unauthorised copying, hiring, renting, public performance ilable and broadcasting of this DVD is strictly prohibited.

S UAL

MAN

on Produc

!

t D

VD

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.

Easy AVR v7

DATA BUS

RX-232

RX-FTDI

J23 RX

TX

TX-232

TX-FTDI

J12

RX-FTDI

TX-FTDI

SW10

PD0

PD1

PD2

PD3

VCC-BRD VCC-BRD VCC-5V VCC-5V

R57

100K

RX-FTDI

TX-FTDI

VCC-BRD

C1

100nF

C2

100nF

9

10

11

12

13

14

7

8

5

6

3

4

1

2

U1

TXD

DTR#

RTS#

VCCIO

RXD

RI#

GND

NC

DSR#

DCD#

CTS#

CBUS4

CBUS2

CBUS3

FT232RL

OSCO

OSCI

TEST

AGND

NC

CBUS0

CBUS1

GND

VCC

RESET#

GND

3V3OUT

USBDM

USBDP

FT232RL

28

27

26

25

24

23

22

21

20

19

18

17

16

15

E1

10uF

VCC-5V VCC-BRD VCC-BRD

R15

2K2

LD12

R16

4K7

LD13

RX-LED1

TX-LED1

C6

100nF

FTDI1-D_N

FTDI1-D_P

R18

1K

R26

2K2

Figure 7-1: USB-UART connection schematic

VCC 1

D-

D+

2

3

GND 4

CN4

USB B

page 15

mikroBUS

sockets

Easier connectivity and simple configuration are imperative in modern electronic devices. Success of the USB standard comes from it’s 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 today’s 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

mikroBUS

host connector

Each mikroBUS

host connector consists of two

1x8 female headers containing pins that are most likely to be used in the target accessory board.

There are three groups of communication pins:

SPI, UART and I

2

C communication. There are also single pins for PWM, Interrupt, Analog input,

Reset and Chip Select. Pinout contains two power groups: +5V and GND on one header and +3.3V

and GND on the other 1x8 header.

SPI and I

2

C selection

Various microcontroller sockets have different pins for

SPI and I

2

C interface. In order to connect the SPI and

I

2

C pins of the mikroBUS

with the desired socket, you have to change appropriate SW3, SW5 or SW6 DIP switches to ON position, Figure 8-1.

PA7

PA6

PA5

SCK

MISO

MOSI

VCC-3.3V

SCK

MISO

MOSI

AN

RST

CS

SCK

MISO

MOSI

3.3V

GND

1

PWM

INT

RX

TX

SCL

SDA

5V

GND

AN

RST

CS

SCK

MISO

MOSI

3.3V

GND

2

PWM

INT

RX

TX

SCL

SDA

5V

GND

PD5

PD3

PD0

PD1

SCL

SDA

VCC-5V

PA4

PB0

PB4

SCK

MISO

MOSI

VCC-3.3V

AN

RST

CS

SCK

MISO

MOSI

3.3V

GND

3

PWM

INT

RX

TX

SCL

SDA

5V

GND

PB3

PB2

PD2

PD3

SCL

SDA

VCC-5V

SW5

SCK2

MISO2

MOSI2

SCK1

MISO1

MOSI1

PB5

PB4

PB3

PB7

PB6

PB5

SCK

MISO

MOSI

SCL

SDA

SCK4

MISO4

MOSI4

SCK3

MISO3

MOSI3

PA4

PA5

PA6

PB2

PB1

PB0

SW3

Figure 8-1: mikroBUS™ socket with DIP switches schematic

SW6

SCL4

SDA4

SCL3

SDA3

SCL2

SDA2

SCL1

SDA1

PB2

PB0

PC0

PC1

PC5

PC4

PA4

PA6

DIP20B

DIP40B

DIP28

DIP14

Easy AVR v7

page 16

PD4

PD2

PD0

PD1

SCL

SDA

VCC-5V

PA0

PA1

PA3

SCK

MISO

MOSI

VCC-3.3V

GSM2 click

GPS2 click

RELAY click

™ THERMO click

™ WiFi PLUS click

Click Boards

are plug-n-play!

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

Easy AVR v7

microSD click

DAC click

DIGIPOT click

IR click

™ page 17

Input/Output Group

One of the most distinctive features of EasyAVR

™ v7 are it’s Input/Output PORT groups. They add so much to the connectivity potential of the board.

Everything is grouped together

PORT headers, PORT buttons and PORT LEDs are next to each other, and grouped together. It makes development easier, and the entire

EasyAVR

v7 cleaner and well organized. We have also provided an additional

PORT headers on the left side of the board, so you can access any pin you want from both sides 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

Tri-state pull-up/down DIP switches

Tri-state DIP switches, like SW1 on Figure 9-2, are used to enable 4K7 pull-up or pull-down resistor on any desired port pin. Each of these switches has three states:

1. middle position disables both pull-up and pull-down feature from the PORT pin

2. up position connects the resistor in pull-up state to the selected pin

Figure 9-2: Tri-state

DIP switch on PORTB

3. down position connects the resistor in pull-down state to the selected PORT pin.

DATA BUS

4k7

+

1 2 3 4 5 6 7 8

UP

PULL

DOWN

_

SW4

VCC-BRD

PB0

PB2

PB4

PB6

VCC-BRD

CN9

PB1

PB3

PB5

PB7

PB0

PB2

PB4

PB6

VCC-BRD

CN10

PB1

PB3

PB5

PB7

PB0

PB2

PB4

PB6

VCC-BRD

CN27

PB1

PB3

PB5

PB7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PB7

VCC-BRD

7

8

5

6

3

4

1

2

9

10

CN11

page 18

PORTB_LED

RN17

10K

LD14

RN18

10K

LD15

RN19

10K

LD16

RN20

10K

LD17

RN21

10K

LD18

RN22

10K

LD19

RN23

10K

LD20

RN24

10K

LD21

VCC-BRD

J1

R12 220

PORTB_LEVEL

+

1 2 3 4 5 6 7 8

VCC

_

GND

SW1

BUTTON PRESS LEVEL

J2

R13 220

SW10

T10 T11 T12 T13 T14

Figure 9-3: Schematic of the single I/O group connected to microcontroller PORTB

T15 T16 T17

Easy AVR v7

Headers Buttons LEDs

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.

Figure 9-4: IDC10 male headers enable easy connection with mikroElektronika accessory boards

The logic state of all microcontroller digital inputs

Figure 9-5: Button press may be changed using

push

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.

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.

PA0

PA1

PA2

PA3

Microcontroller

SMD resistor limiting current

LED (Light-Emitting

Diode) is a highly efficient electronic light source. When connecting LEDs, it is necessary to place a current limiting 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 the corresponding DIP switches on SW10 (Figure

9-6).

Figure 9-6: SW10.5 through SW10.8 switches are used to enable PORT LEDs

Easy AVR v7

page 19

VCC-5V

page 20

P2

10K

VCC-5V

LCD 2x16 characters

IMPORTANT:

Liquid Crystal Displays or LCDs are cheap and popular way of representing information to the end user of some electronic device. Character

LCDs can be used to represent standard and custom characters in the predefined number of fields. EasyAVR

v7 provides the connector and the necessary interface for supporting 2x16 character

LCDs in 4-bit mode. This type of display has two rows consisted of 16 character fields. Each field is a 7x5 pixel matrix. Communication with the display module is done through CN8 display connector. Board is fitted with uniquely designed plastic display distancer, which allows the LCD module to perfectly and firmly fit into place.

Make sure to turn off the power supply before placing LCD onto the board. Otherwise your display can be permanently damaged.

R32

56

Q5

BC846

VCC-BRD

R36

1K

BCK LIGHT

BCK PWM

SW3

DATA BUS

VCC-5V

PD5

Figure 10-1: On-board LCD 2x16 display connector

Connector pinout explained

GND and VCC

- Display power supply lines

Vo

- LCD contrast level from potentiometer P2

RS

- Register Select Signal line

E

- Display Enable line

R/W

- Determines whether display is in Read or Write mode. It’s always connected to GND, leaving the display in Write mode all the time.

D0–D3

- Display is supported in 4-bit data mode, so lower half of the data byte interface is connected to GND.

D4–D7

- Upper half of the data byte

LED+

- Connection with the back-light LED anode

LED-

- Connection with the back-light LED cathode

R37

4K7

Figure 10-2: 2x16 LCD connection schematic

Standard and PWM-driven back-light

CN8

LCD SOCKET

We have allowed LCD back-light to be enabled in two different ways:

1. It can be turned on with full brightness using SW3.1 switch.

2. Brightness level can be determined with PWM signal from the microcontroller, allowing you to write custom back-light controlling software. This back-light mode is enabled with SW3.2 switch.

IMPORTANT:

In order to use PWM back-light both SW3.1 and SW3.2 switches must

be enabled at the same time.

Easy AVR v7

GLCD 128x64

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

BCK LIGHT

BCK PWM

SW3

VCC-5V

PD5

Figure 11-1: GLCD 128x64 connection schematic

P4

VCC-5V

10K

R34

20

Q5

BC846

R37

4K7

VCC-BRD

R36

1K

20

CN16

GLCD-TFT SOCKET2

Connector pinout explained

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

D0–D7

- 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

1

Standard and PWM-driven back-light

As for LCD, we have allowed GLCD back-light to be enabled in two different ways:

1. It can be turned on with full brightness using SW3.1 switch.

2. Brightness level can be determined with PWM signal from the microcontroller, allowing you to write custom back-light controlling software. This back-light mode is enabled with SW3.2 switch.

IMPORTANT:

In order to use PWM back-light both SW3.1 and SW3.2 switches must

be enabled at the same time.

page 21

Easy AVR v7

Touch panel controller

Touch panel is a glass panel whose surface is covered with two layers of resistive material. When the screen is pressed, the outer layer is pushed onto the inner layer and appropriate controllers can measure that pressure and pinpoint its location. This is how touch panels can be used as an input devices.

EasyAVR

v7 is equipped with touch panel controller and connector for 4-wire resistive touch panels. It can very accurately register pressure at a specific point, representing the touch coordinates in the form of analog voltages, which can then be easily converted to X and Y values. Touch panel comes as a part of display.

Correctly placing the touch panel cable into the connector

CN20

1

DATA BUS

Figure 12-4: Touch Panel controller and connection schematic

PA0

PA1

PA2

PA3

page 22

SW8

1

Figure 12-1: Put Touch panel flat cable in the connector

BOTTOM

LEFT

CN16

GLCD-TFT SOCKET2

20

VCC-BRD

RIGHT

TOP

LEFT

Q6

BC856

R40

10K

VCC-BRD

Q9

BC856

R38

1K

R44

10K

Q13

BC846

R41

10K

VCC-BRD

R43

1K

DRIVEA

BOTTOM

R46

100K

R55

100K

C24

100nF

C33

100nF

Q10

BC846

R47

10K

VCC-BRD

E7

10uF

Q11

BC846

R53

10K

VCC-BRD

R52

1K

DRIVEB

BOTTOM

LEFT

DRIVEA

DRIVEB

2

Figure 12-2: Use a tip of your finger to push it inside

Figure 12-3: Now place GLCD with

Touch panel into GLCD socket

3

Enabling Touch panel

Touch panel is enabled using SW8.5,

SW8.6, SW8.7 and SW8.8 switches.

They connect READ-X and READ-Y lines of the touch panel with PA0 and PA1 analog inputs, and DRIVEA and DRIVEB with PA2 and PA3 digital outputs on microcontroller sockets. 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.

Figure 12-5: Turn on switches

5 through 8 on SW8 to enable

Touch panel controller

Easy AVR v7

4 digit

7-seg display

One seven segment digit consist of 7+1

LEDs which are arranged in a specific formation which can be used to represent digits from 0 to 9 and even some letters.

One additional LED is used for marking the decimal dot, in case you want to write a decimal point in the desired segment. EasyAVR

v7 contains four of these digits put together to form 4-digit

7-segment display. Driving such a display is done using multiplexing techniques.

Data lines are shared between segments, and therefore the same segment LEDs in each digit are connected in parallel. Each digit has it’s unique digit select line, which is used to enable the digit to which the data is currently being sent. By multiplexing data through all four segments fast enough, you create an illusion that all four segments are in operation simultaneously.

This is possible because human eye has a slower reaction time than the mention changes. This way you can represent numbers in decimal or hexadecimal form.

Eight data lines that are common for all the digits are connected to PORTC, and digit select lines are connected to PA0–

PA3 lines on the microcontroller sockets.

Enabling the display

To enable digit select lines for the 4-digit

7-segment display you have to turn on SW8.1, SW8.2, SW8.3 and SW8.4 switches. Digit select lines are connected to PA0 – PA3 pins on the microcontroller sockets, while data lines are connected to

PC0 – PC7 pins. Make sure to disconnect other peripherals from the interface lines in order not to interfere with signal/data integrity.

Figure 13-1: Turn on switches

1 through 4 on SW8 to enable

4-digit 7-seg display

Easy

9 8

AVR v7

9 8 9 8 9 8

1 2 4 5 1 2 4 5 1 2 4 5 1 2 4 5

DIS1

R27

10K

DIS0

R30

10K

COM1

Q3

BC846

DIS3

R14

10K

COM0

Q4

BC846

DIS2

R19

10K

COM3

Q1

BC846

DIS0

DIS1

DIS2

DIS3

COM2

Q2

BC846

SW8

PA0

PA1

PA2

PA3

PC0

PC1

PC2

PC3

PC4

PC5

PC6

PC7

R1

R2

R3

R4

R5

R6

R7

R11

470

470

470

470

470

470

470

470 seg A seg B seg C seg D seg E seg F seg Q seg DP

DATA BUS

Figure 13-2: 4-digit 7-segment display schematic

page 23

Enabling DS1820 Sensor

1 2 3

DS1820 - Digital

Temperature Sensor

DS1820 is a digital temperature sensor that uses 1-wire®

interface for it’s operation. It is capable of measuring temperatures within the range of -55 to 128°C, and provides ±0.5°C accuracy for temperatures within the range of -10 to

85°C. It requires 3V to 5.5V power supply for stable operation. It takes maximum of 750ms for the DS1820 to calculate temperature with 9-bit resolution.

1-wire® serial communication enables data to be transferred over a single communication line, while the process itself is under the control of the master microcontroller. The advantage of such communication is that only one microcontroller pin is used. Multiple sensors can be connected on the same line. All slave devices by default have a unique ID code, which enables the master device to easily identify all devices sharing the same interface.

EasyAVR

v7 provides a separate socket

(TS1) for the DS1820. Communication line with the microcontroller is connected via jumper J18.

4

Figure 14-1:

DS1820 not connected

Figure 14-2:

DS1820 placed in socket

Figure 14-3:

DS1820 connected to PB4 pin

Figure 14-4:

DS1820 connected to PA7 pin

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 board’s 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.

Figure 14-5:

DS1820 connected to PB4 pin

page 24

J18

VCC-BRD

C12

100nF

VCC-BRD

R31

1K

GND

DQ

VCC

PA7

PB4

Easy AVR v7

LM35 - Analog

Temperature Sensor

The LM35 is a low-cost precision integrated-circuit temperature sensor, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling.

It has a linear +10.0 mV/°C scale factor and less than 60 μA current drain. As it draws only 60 μA from its supply, it has very low self-heating, less than 0.1°C in still air. EasyAVR

v7 enables you to get analog readings from the LM35 sensor in restricted temperature range from +2ºC to +150ºC. Board provides a separate socket (TS2) for the LM35 sensor in

TO-92 plastic packaging.

Readings are done with microcontroller using single analog input line, which is selected with jumper J19. Jumper connects the sensor with either PA7 or PB4 microcontroller pins.

Enabling LM35 Sensor

1 2 3 4

Figure 15-1:

LM35 not connected

Figure 15-2:

LM35 placed in socket

Figure 15-3:

LM35 connected to PB4 pin

Figure 15-4:

LM35 connected to PA7 pin

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 board’s 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.

Easy AVR v7

PB4

PA7

VCC

VOUT

GND

C23

100nF

J19

Figure 15-5:

LM35 connected to PA7 pin

page 25

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 2

10

=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.

Enabling ADC inputs

VCC-BRD

DATA BUS

Figure 16-2:

Schematic of ADC input

PB1

PB3

PD7

PC4

PA5

PA6

PB0

PB2

PD6

PB4

PB5

PC3

J3

J4

P1

R17

220

C4

100nF

10K

P3

R29

220

C10

100nF

10K

VCC-BRD

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.

Easy AVR v7

page 26

I

2

C EEPROM

Enabling I

2

C EEPROM

In order to connect I

2

C 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 I

2

C 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.

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 I

2

C

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.

What is I

2

C?

I

2

C is a multi-master serial single-ended bus that is used to attach low-speed peripherals to computer or embedded systems. I²C 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.

VCC-BRD VCC-BRD

C25

100nF

VCC-BRD

3

4

1

2

U4

A0

A1

A2

VSS

24C08

VCC

WP

SCL

SDA

8

7

6

5

R48

1K

R49

1K

EEPROM-SCL

EEPROM-SDA

SW5

Easy AVR v7

SCL

SDA

SW6

SCL4

SDA4

SCL3

SDA3

SCL2

SDA2

SCL1

SDA1

PB2

PB0

PC0

PC1

PC5

PC4

PA4

PA6

DIP20B

DIP40B

DIP28

DIP14

DATA BUS

Figure 17-1:

Schematic of

I

2

C EEPROM module connected to

DIP40B socket pins

page 27

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 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.

Supported sound frequencies

Piezo buzzer’s resonant frequency (where you can expect it's best performance) is 3.8kHz, but you can also use it to create sound in the range between 2kHz and 4kHz.

VCC-5V

TOP

VIEW

DATA BUS

R39

1K

PZ1

BUZZER

PERSPECTIVE

VIEW

Figure 18-1: Piezo buzzer connected to PB1 microcontroller pin

VIEW

VCC-5V

PB1

PD4

BUZZER

R42

Q8

BC846

10K

VCC-5V

PZ1

TOP

VIEW

PERSPECTIVE

VIEW

PZ1

VCC-5V

Freq = 3kHz, Duty Cycle = 50%

TOP

VIEW

Freq = 3kHz,

PERSPECTIVE

VIEW

Volume = 50%

PZ1

BC846

Freq = 3kHz, Duty Cycle = 80%

Freq = 3kHz,

PERSPECTIVE

VIEW

Volume = 80%

BC846

Freq = 3kHz, Duty Cycle = 20%

Freq = 3kHz,

Volume = 20%

BC846

R3

1K

R3

1K

10K

R3

1K

10K

R27

10K

J21

BUZZER

RC2

How to make it sing?

RE1 duty cycle of the PWM signal.

RE1

page 28

Enabling Piezo Buzzer

In order to use the on-board Piezo Buzzer in your application, you first have to connect the transistor driver of piezo buzzer to the appropriate microcontroller pin. This is done using jumper

J21. You can place the jumper in two positions, thus connecting the buzzer driver to either PB1 or PD4 microcontroller pin.

Figure 18-2:

Use jumper

J12 to connect

Piezo buzzer on PB1 or

PD4 pin

Easy AVR v7

1

2

Easy AVR v7

3

Additional GNDs

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

GND is located between SW10 and SW8 DIP switches.

2

GND is located between DIP20A and DIP20B sockets.

3

GND is located between DIP28 and DIP40B sockets.

Figure 19-1:

3 oscilloscope

GND pins are conveniently positioned so each part of the board can be reached with an oscilloscope probe

1

3

2

page 29

What’s Next?

You have now completed the journey through each and every feature of

EasyAVR

v7 board

. You got to know it’s 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 don’t have an appropriate compiler? Locate

AVR compiler

that suits you best on the

Product DVD

provided with the package:

DVD://download/eng/software/compilers/

Choose between

mikroC

,

mikroBasic

and

mikroPascal

and download fully functional demo version, so you can begin building your AVR applications.

page 30

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/

EX

AM

PL

AD

DI

TI

ON

AL

SO

ES

FT

WA

RE

• •

• •

• •

• •

COMPI

LERS • • • • • • • • •

MIKROC, M

IKROB

ASIC

, MIK

ROP

ASC

PRODUCT DVD

www.mikroe.com

www.libstock.com

AL C

OM

PIL

ER

S

• •

• •

• •

DR

IV

ER

Ava

MA

HE

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.

S

UAL

MAN ilable

on Produc t D

VD

!

Support

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, that’s 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/

Easy AVR v7

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.

HIGH RISK ACTIVITIES

The products of MikroElektronika are not fault – tolerant nor designed, manufactured or intended for use or resale as on – line control equipment in hazardous environments requiring fail – safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines or weapons systems in which the failure of Software could lead directly to death, personal injury or severe physical or environmental damage (‘High Risk

Activities’). MikroElektronika and its suppliers specifically disclaim any expressed or implied warranty of fitness for High Risk Activities.

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.

Copyright © MikroElektronika

, 2013, All Rights Reserved.

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

[email protected]

EasyAVR v7 User Manual ver. 1.01

0 100000 023297

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement