35
 S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D MikroElektronika Development tools - Books - Compilers Software and Hardware solutions for Embedded World EasyAVR4 Users Manual With useful implemented peripherals, plentiful practical code examples and a broad set of additional add-on boards (Ser ial Ethernet, Co mpact Flash, MMC/SD,  ADC, DAC, CAN, RTC, RS-485, etc.), MikroElektr onika development boards make fast and reliable tools that can satisfy the needs of experienced engineers and beginners alike. 2 in 1  A TMEL DEVELOPMENT BOARD  AVR DEVELOPMENT BOARD  AVR  A TMEL USB 2.0 IN-CIRCUIT PROGRAMMER USB 2.0 IN-CIRCUIT PROGRAMMER

Easyavr4 Manual Hi-quality

Embed Size (px)

DESCRIPTION

easy avr main board view

Citation preview

Page 1: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 1/34

S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

MikroElektronikaDevelopment tools - Books - Compilers

Software and Hardware

solutions for Embedded World

EasyAVR4

User’s Manual

With useful implemented peripherals, plentiful practical

code examples and a broad set of additional add-on

boards (Serial Ethernet, Compact Flash, MMC/SD,

 ADC, DAC, CAN, RTC, RS-485, etc.), MikroElektronika

development boards make fast and reliable tools thatcan satisfy the needs of experienced engineers and

beginners alike.

2 in 1 ATMEL

DEVELOPMENT

BOARD AVRDEVELOPMENT

BOARD AVR

 ATMELUSB 2.0

IN-CIRCUITPROGRAMMER

USB 2.0

IN-CIRCUITPROGRAMMER

Page 2: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 2/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

2

page

 asy VR

USB

4

EasyAVR4 User’s ManualMikroElektronika

Development

tools

No part of this manual, including the product and software described in it, may be repro-

duced, transmitted, transcribed, stored in a retrieval system, or translated into any language

in any form or by any means, except documentation kept buy the purchaser for backup pur-

poses, without the express written permission of MikroElektronika company.

Product warranty or service will not be extended if the product is repaired, modified or altered, unless such repair, modification or alteration is authorized in writing by

MikroElektronika.

MIKROELEKTRONIKA PROVIDE THIS MANUAL “AS IS” WITHOUT WARRANTY OF ANY

KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED

WARRANTIES OR CONDITIONS OF MERCHANTABILITY OR FITNESS FOR A PARTIC-

ULAR PUROSE.

IN NO EVENT SHALL MIKROELEKTRONIKA, ITS DIRECTORS, OFFICERS, EMPLOY-

EES OR DISTRIBUTORS BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR

CONSEQUENTIAL DAMAGES(INCLUDING DAMAGES FOR LOSS OF PROFITS, LOSS

OF BUSINESS, LOSS OF USE OR DATA, INTERRUPTION OF BUSINESS AND THE

LIKE) EVEN IF MIKROELEKTRONIKA HAS BEEN ADVISED OF THE POSSIBILITY OF

SUCH DAMAGES ARISING FROM ANY DEFECT OR ERROR IN THIS MANUAL OR

PRODUCT.

SPECIFICATION AND INFORMATION CONTAINED IN THIS MANUAL ARE FURNISHED

FOR INTERNATIONAL USE ONLY, AND ARE SUBJECT TO CHANGE AT ANY TIME WITH-

OUT NOTICE, AND SHOULD BE CONSTRUED AS A COMMITMENT BY

MIKROELEKTRONIKA

MikroElektronika assumes no responsibility or liability for any errors or inaccuracies that

may appear in this manual, including the product and software described in it.

Product and corporate names appearing in this manual may or may not be registered trade-

marks or copyrights of their respective companies, and are used only for identification or 

explanation and to the owners benefit, without intent to infringe.

Second edition

December 2006

Page 3: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 3/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

3

page

 asy VR

USB

4

EasyAVR4 User’s ManualMikroElektronika

Development

tools

   C   O   N   T   E   N

   T   S

CONNECTING THE SYSTEM page 4

INTRODUCTION page 5

Power Supply page 10

On-board USB 2.0 programmer  page 11

Jumpers page 7

Switches page 6

MCU sockets page 8

LEDs page 14

Pushbutton switches page 16

MMC/SD (Multimedia Card) page 32

7-segment displays page 19

Graphic LCD page 20

LCD 2x16 in 4-bit mode page 21

LCD 2x16 in 8-bit mode page 22

4.096V voltage regulator  page 27

CONTENTS

DESCRIPTION OF THE DEVELOPMENT SYSTEM page 5

JTAG connector  page 31

Direct Port Access page 29

RS-232 Communication page 24

DS1820 Digital Thermometer  page 26

Oscillator  page 12

Page 4: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 4/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

4

page

   C   O

   N   N   E   C   T   I   N   G

   T   H   E   S   Y   S   T

   E   M

CONNECTING THE SYSTEM

Step no.1

Step no.2

Step no.3

Step no.4

The development system box contains the development system, product CD, USB cable,

RS232 cable and this manual.

The first thing to do is to take the system out of the box. Unpack the USB cable and con-

nect it to the PC. Please use USB ports on the back of the PC with direct connection to the

motherboard.

Install the AVRprog programmer and drivers. Start the installation from the product CD:

CD_Drive:\product\zip\AVRprog_setup.exe.

After the installation connect the USB cable to the EasyAVR4 board. You will be asked for 

the AVRprog drivers. Point to them in order to finish the driver installation. They are placed

in the folder:

System_Drive:\Program Files\Mikroelektronika\AVRFLASH\Driver.NT

Run and use AVRprog as explained in the document ‘ AVRprog programmer ’.

CD_Drive:\product\pdf\avrprog_manual.pdf .

After these 4 steps, your EasyAVR4 is installed and ready for use. You can try to read a pro-

gram from the chip or to load an example from the examples folder of mikroElektronika’s

compilers for AVR or from the product CD:

CD_Drive:\product\zip\easyavr4_examples.zip.

Page 5: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 5/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

5

page

 asy VR

USB

4

EasyAVR4 User’s ManualMikroElektronika

Development

tools

   I   N   T

   R   O   D   U   C   T   I   O   N

The EasyAVR4 development system is a full-featured development board for Atmel AVR 

microcontrollers. It has been designed to allow students and engineers to easily exercise and

explore the capabilities of AVR microcontrollers. It allows AVR microcontrollers to be inter-

faced with external circuits and a broad range of peripheral devices, allowing a user to con-

centrate on software development.

Figure 1 illustrates the development board. Each component is marked on a silkscreen, both

top and bottom. These marks describe connections to the microcontroller, operation modes,

and provide some useful notes. The need for additional schematics is minimized since allrelevant information is printed on the board.

INTRODUCTION

Figure 1. EasyAVR4 development board

 ATMEL

DEVELOPMENT

BOARD

 AVRDEVELOPMENT

BOARD

 AVR ATMEL

Page 6: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 6/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

6

page

   S   W   I   T   C   H

   E   S SWITCHES

The EasyAVR4 development board features a number of peripherial devices. In order toenable these devices before programming, you need to check if appropriate jumpers or 

switches have been properly set. Switches are devices that have two positions - ON and

OFF, which have a role to establish or break a connection between two contacts. The

EasyAVR4 development board has three groups of switches.

The first group, SW1, enables connections between the microcontroller port with analog

capabilities (PORTA) and external pull-up/down resistors. The pull-up/down resistors

should be disconnected from the analog input pins, otherwise they will affect the input volt-age level. When PORTA pins are used as digital inputs/outputs, the appropriate pull-

up/down resistors should be enabled.

The second group, SW2, is used to enable LEDs connected to PORTA, PORTB, PORTC

and PORTD. For example, if the switch for PORTB is OFF, all PORTB LEDs will be turned

off.

The upper four switches of SW3 are used to enable SPI communication for interfacing withMMC card. The lower four switches of SW3 are used to enable the 7-segment displays. If 

you don’t need the 7-segment displays in your project, these switches should be OFF.

Switch is ON

Switch is OFF

1     ON

4  

 3  

2  

 5 

 8  

 6  

Figure 2.

Group of 8 switches

Switch 1 is ON, and other 

switches are OFF

Page 7: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 7/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

7

page

 asy VR

USB

4

EasyAVR4 User’s ManualMikroElektronika

Development

tools

   J   U   M   P   E

   R   SJUMPERS

Jumpers, like switches, can break or establish a connection between two points. Beneath the

 plastic cover of the jumper is a metal contact, which makes a connection if the jumper is

 placed between two disconnected pins.

For example, the RS232 communication has two jumpers, J11 and J12, used as switches.

They are used to connect or disconnect Rx pin to PD0 and Tx pin to PD1 pin of the micro-

controller. A connection is made when the jumpers are placed between two contacts.

More often jumpers are used as a selector between two possible connections by using a three

 pin connector. As illustrated in Fig. 4, the middle contact can be connected to the left or right

 pin, depending on the jumper’s position.

Left lineis selected

All lines aredisconnected

Right lineis selected

Jumper is ON

Jumper is OFF

Figure 3.

Figure 4.

Jumper as a switch

Jumper as amultiplexer 

Page 8: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 8/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

8

page

   M   C

   U   S   O   C   K   E

   T   S MCU SOCKETS

EasyAVR4 is delivered with a ATmega16 40-pin microcontroller. Users can remove this one

and fit a different microcontroller in DIP40, DIP28, DIP20, DIP18, DIP14 or DIP8 packages

of an adequate pinout.

Note: Since all packages have parallel connections, there must not be more than one micro-

controller on the board at a time.

Figure 5. MCU sockets

Note: Jumper J13 should be enabled only if you want to use DIP8 microcontroller with

external clock source.

Note: There are two DIP40 sockets, with different pinouts (SKT1 and SKT2). When put-

ting 40-pin microcontoller into DIP40 socket choose the one with corresponding pinout. For 

example, ATmega8535 uses SKT2 socket, while ATmega8515 uses SKT1 socket.

Page 9: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 9/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

9

page

 asy VR

USB

4

EasyAVR4 User’s ManualMikroElektronika

Development

tools

   M   C

   U   S   O   C   K   E

   T   S

DI   P 4  0 

PB1

PB2

PB3

PB4

PB5

PB6

PB7

RST

 VCC

PC7

AVCC

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

GND

XT2

PB0

AREF

AGND

PB5PB5

PORTB

DIP28PB5

DIP20

1 ON

4  

 3  

2  PORTB

J6

SW2

PB5

J2

PB5

VCC

PORTB

CN2

VCC

VCC

Microcontroller’s pins are routed to various peripherals as illustrated in Fig. 6. All ports have

direct connections to Direct Port Access connectors. Such connectors are typically used for 

connecting external peripherals to the board or for providing useful points for connectingdigital logic probe.

All ports are connected to LEDs, push-button switches and pull-up/down resistors, which

allow easy monitoring and testing of digital pin state .

Some pins are connected to other peripherials such as the DS1820 temperature sensor, RS-

232 communication, 7-segment displays, LCD, etc.

System connectionFigure 6.

Page 10: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 10/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

10

page

   P   O   W

   E   R   S   U   P   P

   L   Y

As a power supply source, users can select either a regulated supply from the USB cable

(default) or an external power supply. In case of the USB power supply, the system should

 be connected to a PC using the USB programming cable, while the jumper J10 should be

set in the right-hand position.

In the case of an external power supply, the EasyAVR4 board produces +5V using an

LM7805 voltage regulator. The external power supply can be AC or DC, with a voltage

 between 8V and 16V and the jumper J10 should be set in the left-hand position. In Fig. 7

you can see USB and external power supply connectors.

GND

 Vin   Vout

VCC

CN7   8-16V (AC/DC)

+

E1470uF C2100nF

E3470uF

C9100nF

1

2

 VCC

D-

D+

GND

5V   5V

USB

FP1

1

 

3

USB yPower Suppl

External Power Supply

EXT

EXT

USB

USB

REG17805

J14

C1100nF

POWER SUPPLY

J10 in the left-hand

position: system will

take power from theexternal AC/DC

power adapter.

J10 in the right-hand

position: system will

take power from the

USB cable.

USB and power supply connectorsFigure 7.

Figure 8. Power supply select jumper

Figure 9. J10 is set to USB power supply

EXT USB

USB

connector 

USB

connector 

External power 

supply connector 

POWER SUPPLY 

SELECTABLE

POWER SUPPLY 

SELECTABLE

Page 11: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 11/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

11

page

 asy VR

USB

4

EasyAVR4 User’s ManualMikroElektronika

Development

tools

   O   N  -   B   O   A   R

   D   U   S   B   P   R

   O   G   R   A   M   M

   E   RON-BOARD USB 2.0 PROGRAMMER

There is no need for the use of externalequipment during programming, as the

EasyAVR4 development system has its

own on-board USB 2.0 programmer.

All you need to do is connect the system

to a PC using the USB cable. Then, load

your program into the microcontroller 

via the AVRprog programming software,

which is supplied with the board.

VCC

USB LINK

27

SWITCH

TO PERIPHERALSON DEVELOPMENT BOARD

AV R  pr  o  g

 On-B o ar  d  U S B

  pr  o  gr  amm er 

 VCCD-

D+

GND

USB

CN81

2

34

USB CONN.

VCC

27

    1    K

POWER

    1    K

      1      0      K

      R    e    s    e      t

        1

        0         0 

      n

VCC

VCC

A T ME 

 GA x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

Figure 10. On-Board USB programmer 

Figure 11. Switch schematic

 Note: There is no need for manually reseting MCU after programming. The programmer 

will reset the MCU automatically.

USB 2.0

IN-CIRCUITPROGRAMMER

USB 2.0

IN-CIRCUITPROGRAMMER

Page 12: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 12/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

12

page

   O   S   C   I   L   L   A   T

   O   R OSCILLATOR

EasyAVR4 development board has on-board oscillator circuit for generating microcon-troller’s clock input. Within the  AVRprog  programmer you can either choose internal RC

oscillator or external clock. External oscillator is connected to the XT1 pin of the microcon-

troller. Microcontroller in DIP8 package doesn’t have pin that is dedicated only for the

oscillator clock input. Because of the small pin count, it has PB4 pin multiplexed between

I/O and clock input function.

Figure 12.Oscillator 

Note: Jumper J13 should be enabled only if you want to use DIP8 microcontroller with

external clock source.

If you want to use pin PB4 with I/O function you should use internal RC oscillator. If you

don’t need I/O function of the PB4 pin, then you can use on-board oscillator by enabling

 jumper J13. By doing this, you are making a direct connection between the oscillator circuit

and PB4 pin.

E AVR4 U ’ M lM roE ro

Page 13: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 13/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

13

page

 asy VR

USB

4

EasyAVR4 User’s ManualMikroElektronika

Development

tools

   O   S   C   I   L   L   A   T

   O   R

A T 

ME  GA x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

      1      0       0      n

VCC

GND

 VCCA

B

C

D

E

F

      C       1      2

      2      2     p        F

      C       1      1

      2      2     p        F

74HC04

X28MHz

R81K

R7 1M

PB4

J13

VCC

Figure 13. Oscillator connection with MCU

Note: In order to simplify the schematics in this man-

ual, the oscillator circuit is represented by this symbol.

OSCILLATOR

E AVR4 U ’ M lMikroElektronika

Page 14: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 14/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

14

page

   L   E

   D  s

Light Emitting Diodes (LEDs) are the most commonly used components, usually for dis-

 playing pin’s digital state. EasyAVR4 has 32 LEDs that are connected to the microcon-

troller’s PORTA, PORTB, PORTC and PORTD.

LEDs

Figure 14. Light Emitting Diodes

Each group of eight LEDs can be enabled or disabled using the switch SW2. Fig. 15. illus-

trates the connection of a LEDs to PORTA of the microcontroller. A resistor is used in series

with the LED to limit the LED's current. In this case the resistor's value is 1K.

E AVR4 U ’ M lMikroElektronika

Page 15: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 15/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

15

page

 asy VR

USB

4

EasyAVR4 User’s ManualDevelopment

tools

The LEDs are enabled when the corresponding switch on SW2 is on. When enabled, LEDs

will display the state of the corresponding microcontroller pin; otherwise the LEDs will

always be off, no matter what the port state is, as no current can flow through LED.

RN6

R-SIL 8/9

1

2

3

4

5

6

789

PA0

PA1

PA2

PA3

PA4

PA5

PA6

PA7

1 ON

4  

 3  

2  

PORTD LED

PORTC LED

PORTB LED

PORTA LED

CURRENT FLOW

A T ME 

 GA x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

10K

      R    e    s    e

      t

        1        0         0 

      n

VCC

10K

Figure 15.LED schematic

EasyAVR4 User’s Manual  MikroElektronika

Page 16: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 16/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User s Manual Development

tools

16

page

   P   U   S   H   B   U   T   T   O   N   S   W   I   T   C   H

   E   S

A T 

ME  GA x x 

x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

      1      0       0      n

VCC

 AVRprogOn-Board USB

programmer 

EasyAVR4 has 32 push buttons, which can be usedto change states of digital inputs to microcontroller's

 ports. There is also one switch that acts as a RESET.

Reset switch schematic is shown in Figure 17.

PUSHBUTTON SWITCHES

Figure 18.

Pushbutton switches

Figure 16. Reset switch

Figure 17.

Reset switch schematic

EasyAVR4 User’s ManualMikroElektronika

Page 17: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 17/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

17

page

 asy VR

USB

4

EasyAVR4 User s ManualDevelopment

tools

   P   U   S

   H   B   U   T   T   O   N

   S   W   I   T   C   H

   E   S

VCC

RA0

RA1

RA2

RA3

RA4

RA5

RA6

RA7

RB0

RB1

RB2

RB3

RB4

RB5

RB6

RB7

RC0

RC1

RC2

RC3

RC4

RC5

RC6

RC7

RD0

RD1

RD2

RD3

RD4

RD5

RD6

RD7

PORTA   PORTB   PORTC   PORTD

0V while buttonis pressed

+5V while buttonis pressed

J6

A T 

ME  GA x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1

      0      K

      R    e    s    e      t

        1        0         0 

      n

VCC

Figure 19.

Buttons schematic

Buttons connections to PORTA, PORTB, PORTC and PORTD are shown in Fig. 19. Jumper 

J6 determines whether a button press will bring logical zero or logical one to the appropri-

ate pin.

When button is not pressed, pin state is determined by the pull-up or pull-down port

 jumpers.

In the example shown in Fig. 19, J6 is connected to +5V, therefore pressing the buttons will

 bring logical one to the appropriate pins.

EasyAVR4 User’s Manual  MikroElektronika

Development

Page 18: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 18/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User s Manual Development

tools

18

page

   P

   U   S   H   B   P   U   S   H   B   U   T   T   O   N   S   W   I   T   C   H

   E   S On Fig. 20 the J1 jumper is set

to pull-up, therefore when the

 button is not pressed, pull-up

resistor pulls the microcon-

troller’s PA3 pin to +5V.

A button press causes the port

 pin to be connected to ground

(J6 is in the lower position).

Thus, only when the button is pressed the microcontroller 

will sense a logical zero; other-

wise the pin state will always

 be logical one.

On Fig. 21 the J6 jumper is set

to pull-down, therefore when

the button is not pressed, pull-

down resistor pulls the micro-

controller’s PA3 pin to 0V.

A button press causes the port

 pin to be connected to +5V (J6

is in the higher position).

Thus, only when the button is

 pressed the microcontroller 

will sense a logical one; other-

wise the pin state will always

 be logical zero.

AT ME  GA

PB1

PB2

PB3

PB4

PB5

PB6

PB7

RST

 VCC

PC7

AVCC

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

GND

XT2

PB0

AREF

AGND

PA3

PORTApull-up

0V while pressed

vcc

J1

1

ON

8765432     S      W     1

vccJ6

VCC

AT ME  G

A

PB1

PB2

PB3

PB4

PB5

PB6

PB7

RST

 VCC

PC7

AVCC

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

GND

XT2

PB0

AREF

AGND

PA3

PORTApull-down

5V while pressed

vcc

vcc

J1

1

ON

8765432     S 

     W     1

J6VCC

Figure 20.

Figure 21.

Button with pull-up resistor 

Button with pull-down resistor 

EasyAVR4 User’s ManualMikroElektronika

Development

Page 19: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 19/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

19

page

 asy VR

USB

4

EasyAVR4 User s ManualDevelopment

tools

7-SEGMENT DISPLAYS

EasyAVR4 has four 7-segment displays in multiplex mode. Data lines are connected to

PORTA, while each display is enabled through the lower four bits of PORTB.

dp

R28

10K

Q1

e

d

c

dp

b

a

g

Q4Q3Q2

10K   10K 10K

R29   R30   R31

8 . a

b

c

d

e

g

PB7   SCK

PB6   MISO

PB5   MOSI

PB4 MMC-CS

DIS3

DIS3 DIS2 DIS1 DIS0

PB3

DIS2PB2

DIS1PB1

DIS0PB0

1 ON

 8  

 6  

 5 4  

 3  

2  

SW3

R2 - R9

8 . 1 2 3   4   5

10 9 8   7   6

8 . 1 2 3   4   5

10 9 8   7   6

8 . 1 2 3   4   5

10 9 8   7   6

8 . 1 2 3   4   5

10 9 8   7   6

A T ME 

 G

A x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

        1

        0         0 

      n

VCC

Figure 22.

7-segment displays

Figure 23. 7-segment displays schematic

8 . 8 . 

7

S

E

G

7

S

E

G

RE

 A 

D Y 

RE

 A 

D Y 

EasyAVR4 User’s Manual  MikroElektronika

Development

Page 20: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 20/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User s Manualtools

20

page

   G   R   A   P   H   I   C

   L   C   D   1   2   8   X

   6   4

In order to enable GLCD,

 jumper J8 should be set to

the upper position, labeled

as GRAPH.

GRAPHIC LCD

A graphic LCD (GLCD) allows advanced visual messages to be displayed. While a charac-

ter LCD can display only alphanumeric characters, a GLCD can be used to display mes-

sages in the form of drawings and bitmaps. The most commonly used graphic LCD has the

screen resolution of 128x64 pixels. Before a GLCD is connected, the user needs to set the

 jumper J8 (Fig. 24) to the upper position. The GLCD’s contrast can be adjusted using the

 potentiometer P1, which is placed to the right of the GLCD.

A T ME  GA x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

        1        0         0 

      n

VCC

P1 10K

 Vee

 VoContrastAdjustment

J8

GRAPH.

CHAR.

R/W

E

D7

D6

D5

D4

D3

D2

VCC

VCC

    D    5 

    D    4

    D    3 

    D    2

    D    1

    D    0     E

    R    /     W    R

    S 

    L    E    D  -

    V   o 

    L    E    D    +

      V      C       C 

    V   e    e 

    G     N    D

    R    S     T

    C     S     2

    D    7

    C     S     1

    D    6 

1   20

LCD8 contrastselected

GLCD and LCD8contrast not selected

GLCD contrastselected

R19 10

VCC

CS1

CS2

RS

D1

D0

RST

    P    A    5 

    P    A    4

    P    A    3 

    P    A    2

    P    A    1

    P    A    0 

    P    D    6 

    P    D    5 

    P    D    4

    P    D    7

    P    D    3 

    P    A    7

    P    D    2

    P    A    6 

Figure 26.

GLCD schematic

Figure 24.

Figure 25.

GLCD selection jumper 

GLCD

GRAPHIC LCD

CONNECTOR

ON-BOARD

GRAPHIC LCD

CONNECTOR

ON-BOARD

EasyAVR4 User’s ManualMikroElektronika

Development

Page 21: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 21/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

21

page

 asy VR

USB

4

EasyAVR4 User s Manualtools

   L   C   D   2   X   1   6   I   N

   4       -   B   I   T   M   O

   D   E

2x16 LCDx 6 LCD

2x16 LCDCONNECTOR2x16 LCDCONNECTOR

ON-BOARDON-BOARD

A standard character LCD is probably the most widely used data visualization component.

Usually, it can display two lines of 16 alphanumeric characters, each made up of 5x8 pix-els. The character LCD communicates with the microcontroller via a 4-bit or 8-bit data bus,

each requiring the use of a different connector on EasyAVR4. For 4-bit data bus use, the

LCD should be placed in the upper left of the board, just above the LEDs. The connection

to the microcontroller is shown in Fig. 28 where there are only four data lines. It is impor-

tant to note that the LCD should be placed or removed from EasyAVR4 only when the

 power is off.

LCD 2X16 IN 4-BIT MODE

    D    7

    D    6 

    D    5 

    D    4

    D    3 

    D    2

    D    1

    D    0     E

    R    /     W    R

    S 

    V    E    E

    V    C     C 

    G     N    D

P210K

ContrastAdjustment

1 14

VCC

LCD Display

4-bit mode

A T ME  GA x 

x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

    1    0     0    n

VCC

    P    A    7

    P    A    6 

    P    A    5 

    P    A    4

    G     N    D

    G     N    D

    G     N    D

    G     N    D

    P    D    6 

    G     N    D

    P    D    4

RS

E

D4

D5

D6

D7

Figure 27.

Figure 28.

LCD 2x16 in 4-bit mode

LCD 2x16 in 4-bitmode schematics

EasyAVR4 User’s Manual  MikroElektronika

Development

Page 22: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 22/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

EasyAVR4 User s Manualtools

22

page

   L   C   D   I   N

   8       -   B   I   T   M   O

   D   E

2x16 LCDx 6 LCD

2x16 LCDCONNECTOR2x16 LCDCONNECTOR

ON-BOARDON-BOARD

The LCD must be placed in the marked position with two free pins to the left and four free

 pins to the right. It is important to note that the LCD should be placed or removed from

EasyAVR4 only when the power is off. Before attaching the LCD, set jumper J8 to the lower 

 position. The LCD's contrast can be adjusted using potentiometer P1 which is located to the

right of the GLCD/LCD connector.

LCD 2X16 IN 8-BIT MODE

When using a character LCD in 8-bit mode, the connector that is shared with the GLCDshould be used. Since this connector has 20 pins and the character LCD has only 14 pins,

special attention is required when placing the LCD. Otherwise the LCD can be permanent-

ly damaged.

Figure 29.

LCD 2x16 in 8-bit mode

NOTE: Special attention is required when placing the LCD. Otherwise the LCD can be per-

manently damaged.

View from the back:shows which pins

stays disconnected.

EasyAVR4 User’s ManualMikroElektronika

Development

tools

Page 23: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 23/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

23

page

 asy VR

USB

4

ytools

   L   C   D   2   X   1   6   I   N

   8       -   B   I   T   M   O

   D   E

A T ME 

 GA x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

        1        0         0 

      n

VCC

P1 10K

 Vee

 VoContrastAdjustment

J8

GRAPH.

CHAR.

R/W

E

D7

D6

D5

D4

D3

D2

VCC

LCD8 contrastselected

GLCD and LCD8contrast not selected

GLCD contrastselected

VCC

RS

D1

D0

    D    7

    D    6 

    D    5 

    D    4

    D    3 

    D    2

    D    1

    D    0     E

    R    /     W    R

    S 

    V    E    E

    V    C     C 

    G     N    D

1 14

LCD Display

8-bit mode

    P    A    7

    P    A    6 

    P    A    5 

    P    A    4

    P    A    3 

    P    A    2

    P    A    1

    P    A    0 

    P    D    6 

    P    D    5 

    P    D    4

Figure 30. LCD 8-bit mode schematic

Leave two free

pins to the left side

Leave four free pinsto the right side

In order to enable LCD,

 jumper J8 should be set to

the lower position, labeled

as CHAR.

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

Page 24: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 24/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

4

ytools

24

page

   R   S       -   2   3   2   C   O   M   M   U   N   I   C   A   T   I   O   N RS-232 COMMUNICATION

RS-232 communication enables point-to-point data transfer. It is commonly used in dataacquisition applications, for the transfer of data between the microcontroller and a PC. Since

the voltage levels of a microcontroller and PC are not directly compatible with each other,

a level transition buffer such as the MAX232 must be used.

Figure 31. RS232 connectors

In order to provide a more flexible system, the microcontroller is connected to the MAX232

through the two jumpers: J11 and J12. The jumper J11 is used to connect the Rx line to PD0

 pin. The jumper J12 is used to connect the Tx line to PD1 pin.

ENABLEDENABLED

RS232RS232

EasyAVR4 User’s ManualMikroElektronika

Development

tools

Page 25: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 25/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

25

page

 asy VR

USB

4

   R   S       -   2   3   2   C   O   M   M   U   N   I   C   A   T   I   O   N

MAX 2  3 2 

C1+

 VS+

C1-

C2+

C2-

 VS-

T2OUT

R2IN

 VCC

GND

T1OUT

R1IN

R1OUT

T1IN

T2IN

R2OUT

1

2

3

4

5

6

7

8

16

15

14

13

12

11

10

9

U6

RS-232CON

CONNECTMCU TO PC

Receivedata (Rx)

SendData (Tx)

1 5

6 9

        1   2   3    4 5         6    7 8    9 

CN9SUB-D 9p

C18100nF

CONNECT

PC TO MCU

1 5

6

Rx

Tx

9

SERIALCABLE

PC

RS-232 ACON

E910uF

E1010uF

E1110uF

E1210uF VCC

VCC

A T ME 

 G

A x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

        1        0         0 

      n

VCC

J11J12

RS232 COMM.Enabled

RS232 COMM.Disabled

Figure 32.

Connection between microcontroller and a PC

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

Page 26: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 26/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

426

page

   D

   S   1   8   2   0   D   I   G   I   T   A   L   T   H

   E   R   M   O   M   E   T

   E   R

DS1820 digital thermometer is well suited to envi-

ronmental temperature measurement, having thetemperature range of -55°C to 125°C and the accura-

cy of +/-0.5°C. It must be placed correctly in the 3-

 pin socket provided on EasyAVR4, with its rounded

side to the lower edge of the board (see Fig. 33) oth-

erwise the DS1820 could be permanently damaged.

DS1820’s data pin can be connected to either PC6 or 

PC7 pin, which is determined by jumper J7.

J7

DS1820

 VCCR1

10KGND

DQ

DQ line isconnected to PC6

DQ line isconnected to PC7

DQ line isconnecteddis

-55 C

125 C

VCC

VCC

A T ME 

 GA x 

x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

        1        0         0 

      n

VCC

There is a mark inthe form of half-cir-cle for proper ori-entation of DS1820sensor.

DS1820 DIGITAL THERMOMETER

Figure 33.

Figure 34.

DS1820

DS1820 schematic

EasyAVR4 User’s ManualMikroElektronika

Development

tools

Page 27: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 27/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

27

page

 asy VR

USB

4

   4 .   0   9   6   V

   V   O   L   T   A   G   E

   R   E   F   E   R   E   N

   C   E4.096V VOLTAGE REFERENCE

Figure 35.

4.096V voltage reference

Some of the Atmel’s microcontrollers have integrated A/D Converter (Analog-to-Digital

Converter). In order for A/D Converter to work, voltage reference must be used. It repre-

sents a maximum value that can be measured by microcontroller. EasyAVR4 uses 4.096V

voltage reference because number 4096 is a power of 2 which makes it easy to represent val-

ues as binary numbers in microcontroller. In case of the 10-bit A/D Converter the resolution

will be 4mV per bit. In case of the 12-bit A/D Converter the resolution will be 1mV per bit.

Analog input pins are placed on PORTA of microcontroller. In order to measure analog sig-nal without interference, turn the coresponding switch on SW1 to OFF position. This will

disable connection of the used PORTA pin to the pull-up/down resistors.

Applications of A/D Conversion are various. Microcontroller takes analog signal from its

input pin and translates it into a digital value. Basically, you can measure any analog signal

that fits in range acceptable by MCU. With 4.096V voltage reference used (jumper J9 in

lower position) this range is 0V-4.096V. If you place jumper J9 in upper position 5V will beused as voltage reference and therefor measure range will be 0V-5V.

 VREF4.096V ON-BOARD

 VREF4.096V ON-BOARD

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

Page 28: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 28/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

428

page

   4 .   0   9   6   V

   V   O   L   T   A   G   E

   R   E   F   E   R   E   N

   C   E

E1410uF

R121K

 VOUT VIN

GNDR11100

1

2

3

REF1

MCP1541

J9

5V voltagereference

4.096V voltagereference

T ME  GA x x 

x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

        1        0         0 

      n

VCC

VCC

VCC

VCC

PORTApull-up

vcc

J1

1

ON

8765432     S      W     1

ADC7

ADC6

ADC5

ADC4

ADC3

ADC2

ADC0

ADC1

AREF

Figure 36.

4.096V voltage reference schematic

Pull-up/down resistors on

PORTA analog input pins

should be disabled using

SW1

EasyAVR4 User’s ManualMikroElektronika

Development

tools

Page 29: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 29/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

29

page

 asy VR

USB

4

   D   I   R   E   C   T   P   O   R   T   A   C   C   E   S   S

DIRECT PORT ACCESS

Direct port access connectors

Example of how to connectexternal peripheral with flat

cable

These connectors can be used for system expansion with external boards such as Serial

Ethernet, Compact Flash, MMC/SD, ADC, DAC, CAN, RTC, RS-485, etc. Ensure that the

on-board peripherals are disconnected from microcontroller by setting the appropriate

 jumpers, while external peripherals are using the same pins. The connectors can also be usedfor attaching logic probes or other test equipment.

All microcontroller input/output pins can be accessed via connectors placed along the right

side of the board. For each of PORTA, PORTB, PORTC, PORTD and PORTE there is one

10-pin connector providing VCC, GND and up to eight port pins.

Figure 37.

Figure 38.

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

Page 30: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 30/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

430

page

   D   I   R   E   C   T   P

   O   R   T   A   C   C   E   S   S

A T ME  GA x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

    1    0     0 

   n

VCC

PC4

PC6

PC0

PC2

PC5

PC7

PC1

PC3

HEADER 5x2

CN3

PC6

PC7

PC4

PC5

PC2

PC3

PC0PC1

8

9

6

7

4

5

23

1

2

3

1  J3

Pull-up line is

connected

All linesare disconnected

Pull-down lineis connected

RN3

RPACK8/98x10K

VCC

VCC

Figure 39.

PORTC connection

EasyAVR4 User’s ManualMikroElektronika

Development

tools

Page 31: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 31/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

31

page

 asy VR

USB

4

   J   T   A   G

   C   O   N   N   E   C   T

   O   R

JTAG connector can be used as serial programming interface or On-Chip debug system. For the On-chip Debug system, in addition to the JTAG interface pins, the RESET pin is mon-

itored by the debugger to be able to detect external reset sources. The debugger can also pull

the RESET pin low to reset the whole system. The JTAG interface is accessed through four 

of the microcontroller’s pins:

- TMS: Test Mode Select,

- TCK: Test Clock,

- TDI: Test Data In,- TDO: Test Data Out.

T ME  GA x x 

x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

        1        0         0 

      n

VCC

TMS

 Vsupply

TCK

TDO

nSRST

nTRST

GND

 VTref 

HEADER 5x2

CN6   VCC

TDI   GND

JTAGCONNECTOR

VCC

NC

mRST

mRST

JTAG CONNECTOR

Figure 40.JTAG connector schematic

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

Page 32: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 32/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

432

page

   M   M   C   /   S   D   (   M   U   L   T   I   M

   E   D   I   A   )   C   A

   R   D

To enable MMC card you must turn on switches 1, 2, 3 and 4 on SW3. By doing that, micro-

controller’s SPI comunnication lines (SDI, SDO and SCK) and Chip Select are connected to

MMC. Working voltage of EasyAVR4 is 5V DC, while working voltage of MMC card is

3.3V DC. Because of that, there is a voltage regulator on-board with MMC card

(MC33269DT-3.3). Data lines from microcontroller to MMC card must be also adjusted to

3.3V. It is done with resister voltage dividers as shown on Figure 42.

MMC card is used as storage media for a portable devices, in a form that can easily be

removed for access by a PC. For example, a digital camera would use an MMC card for 

storing image files. With an MMC reader (typically small box that connects via USB or 

some other serial connection) you can easily transfer data from MMC card to your comput-

er. Microcontroller on EasyAVR4 communicates with Multi Media Card via SPI communi-

cation.

MMC/SD (MULTIMEDIA CARD)

Figure 41.

MMC slot on-board

Modern computers, both lap-

tops and desktops, oftenhave SD slots, which can

read MMC cards.

MMC/SDMASS STORAGE

MMC/SDMASS STORAGE

SUPPORTEDSUPPORTED

256MB

EasyAVR4 User’s ManualMikroElektronika

Development

tools

Page 33: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 33/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D

33

page

 asy VR

USB

4

   M   M   C   /   S   D   (   M   U   L   T   I   M   E   D   I   A   C   A

   R   D   )

SPI-SDO

SPI-SCK

MMC-CS#

SPI-SDI

R143K3

R163K3

R132K2

R152K2

R172K2

R183K3

MMC-CS#

SPI-SDO

SPI-SDI

SPI-SCK

76

5432

1

CN12

MMC/SDCARDDout

GND

SCK+3.3VGND

Din

CS

1     ON

 8  

 6  

 5 

4  

 3  

2  

SW3

C20100nF

VCC3

C19100nF

VCC

 VOUT

 VINGND

VCC

3

1 2

REG2

VCC3

E1510uF

MC33269DT-3.3

PB5

PB7

PB6

PB4

VCC3

A T ME  G

A x x x x 

PB1

PB2

PB3

PB4

PD1

PD2

PB5

PB6

PB7

PD4

PD5

PD6

PC1

PC0

PD7

PC2

PC3

PC4

PC5

PC6

PC7

PA7

PA6

PA5

PA4

PA3

PA2

PA0

PA1

PD3

PB0

PD0

RST

 VCC

GND

XT2

XT1

AREF

AGND

AVCC

VCC

OSCILLATOR

      1      0      K

      R    e    s    e      t

        1        0         0       n

VCC

Figure 42.MMC schematic

EasyAVR4 User’s Manual  MikroElektronika

Development

tools

Page 34: Easyavr4 Manual Hi-quality

7/18/2019 Easyavr4 Manual Hi-quality

http://slidepdf.com/reader/full/easyavr4-manual-hi-quality 34/34

M I K R O E L E K T R O N I K A S O F T W A R E A N D H A R D W A R E S O L U T I O N S F O R T H E E M B E D D E D W O R L D asy VR

USB

434

page

If you are experiencing problems with any

of our products or you just want additional

information, please let us know. We arecommitted to meeting your every need.

Technical Support :

[email protected]

If you have any other question, comment

or a business proposal, please contact us:

E-mail: [email protected]

Web: www.mikroe.com

Forum: www.mikroe.com/forum/