BigAVR Manual - MikroElektronika

BigAVR Manual - MikroElektronika

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

BigAVR

User’s Manual

2 in

1

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 that can satisfy the needs of experienced engineers and beginners alike.

Software and Hardware solutions for Embedded World

MikroElektronika

Development tools

BigAVR User’s Manual

First edition

December 2006

No part of this manual, including the product and software described in it, may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language in any form or by any means, except documentation kept buy the purchaser for backup purposes, without the express written permission of MikroElektronika company.

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

MikroElektronika.

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

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

WARRANTIES OR CONDITIONS OF MERCHANTABILITY OR FITNESS FOR A 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 trademarks or copyrights of their respective companies, and are used only for identification or explanation and to the owners benefit, without intent to infringe.

BigAVR

with

USB 2.0 PROGRAMMER

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 page

MikroElektronika

Development tools

BigAVR User’s Manual

CONTENTS

CONNECTING THE SYSTEM

INTRODUCTION

DESCRIPTION OF THE DEVELOPMENT SYSTEM page 4 page 5 page 6

Switches and their functions

Jumpers

MCU sockets

Power Supply

On-Board USB 2.0 programmer

Oscillator

LEDs

Pushbutton switches

Graphic LCD

LCD 2x16 in 4-bit mode

LCD 2x16 in 8-bit mode

RS-232 Communication

DS1820 Digital Thermometer

A/D Converter input

PS/2 (Keyboard) connector

Direct port access

JTAG connector

MMC/SD (Multimedia Card)

page 6 page 7 page 8 page 11 page 12 page 14 page 15 page 17 page 20 page 22 page 24 page 26 page 29 page 30 page 32 page 33 page 35 page 36

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

CONNECTING THE SYSTEM

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

RS232 cable and this manual.

Step no.1

The first thing to do is to take the system out of the box. Unpack the USB cable and connect it to the PC. Please use USB ports on the back of the PC with direct connection to the motherboard.

Step no.2

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

CD_Drive:/product/zip/AVRFlash_setup.exe

.

Step no.3

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

AVRFlash drivers. Point to them in order to finish the driver installation. They are placed in folder:

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

Step no.4

Run and use AVRFlash as it is explained in the PDF document ‘AVRFlash programmer’:

CD_Drive:/product/pdf/avrprog_manual.pdf

After these 4 steps, your BigAVR is installed and ready for use. You can try to read a program 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/bigavr_examples.zip

.

page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

INTRODUCTION

The BigAVR development system is a full-featured development board for Atmel AVR microcontrollers. It has been designed to allow students and engineers to easily exercise and explore the capabilities of AVR microcontrollers. It allows AVR microcontrollers to be interfaced with external circuits and a broad range of peripheral devices, allowing a user to concentrate on software development.

Figure 1 illustrates the development board. Each component is marked on a silkscreen, both top and bottom. These marks describe connections to the microcontroller, operation modes, and provide some useful notes. The need for additional schematics is minimized since all relevant information is printed on the board.

Figure 1.

BigAVR development board

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

SWITCHES

The BigAVR development board features a number of peripherial devices. In order to enable these devices before programming, you need to check if appropriate jumpers or switches have been properly set. Switches are devices that have two positions - ON and

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

BigAVR development board has four groups of switches.

The first two groups, SW1 and SW2, are used to enable LEDs connected to PORTA,

PORTB, PORTC, PORTD, PORTE, PORTF, PORTG, PORTH, PORTJ, PORTK and

PORTL. Switch SW2 is also used to enable connection between DS1820 temperature sensor and microcontroller PG0 pin and also to enable SPI communication and CS pin for

MMC/SD Card.

The switches of SW4 are used to enable a connection between the microcontroller PORTF with external pull-up/down resistors. When PORTF pins are used as digital inputs/outputs, the appropriate pull-up/down resistors should be enabled.

The switches of SW3 are used to enable connection between the microcontroller pins and both RS232 communication devices. The first four switches are used for RS232-A communication lines, while the second four are used for RS232-B communication lines.

Figure 2.

Group of 8 switches

Switches 1 and 2 are ON, and other switches are OFF

Switch is ON

page

Switch is OFF

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

JUMPERS

Jumpers, like switches, can break or establish a connection between two points. Beneath the plastic cover of the jumper is a metal contact, which makes a connection when the jumper is placed between two disconnected pins.

For example, the jumpers J15 and J16 are used to connect or disconnect PS/2 Data and Clk lines to the PC0 and PC1 pins, respectively. A connection is made when the jumper is placed between two contacts.

Figure 3.

Jumper as a switch

Jumper is ON

Jumper is OFF

Figure 4.

Jumper as a multiplexer

More often, jumpers are used as a selector between two possible connections using a three pin connector. As illustrated in Fig. 4, the middle connector can be connected to the left or right pin, depending on the jumper’s position.

All lines are disconnected

Left line is selected

Right line is selected

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

MCU CARD

The BigAVR development board has a 104-pin MCU Card. If you want to use some other microcontroller, all you have to do is to change MCU Cards. You can use 64-pin MCUs

(ATmega128 for example) or 100-pin MCUs (ATmega1280 for example). BigAVR MCU

Card is shown on the following picture:

MCU Card

Figure 5.

page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

When you are placing MCU Card on the BigAVR MCU socket, you must follow these steps:

Step no.1

If there is already MCU Card placed on BigAVR, you must remove it by slowly pulling it up.

Step no.2

Place MCU Card on the board.

Note that label on the MCU Card must be at the upper-left corner as it is drawn on the BigAVR board.

Step no.3

When MCU Card is on the place, push it down by applying the pressure on all edges at the same time.

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

Microcontroller’s pins are routed to various peripherals as illustrated in Fig. 6. All ports have direct connections to Direct Port Access connectors. Such connectors are typically used for connecting external peripherals to the board or for providing useful points for connecting digital logic probe.

All ports are connected to LEDs, push-button switches and pull-up/down resistors, which allow easy monitoring and testing of digital pin state .

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

RS-232 communication, LCD, etc.

PORTE

CN5

PE3

PORTE

SW1

VCC

PE3

J12

VCC

PORTE

VCC

J5

VCC

PE3 page

Figure 6.

System connection

VCC

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

ATmega128

PC4

PC3

PC2

PC1

PC0

PG1

PG0

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

C1

22pF

X1

10MHz

C2

22pF

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

POWER SUPPLY

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

(default) or an external power supply. In case of the USB power supply, the system should be connected to a PC using the USB programming cable, while the jumper J14 should be set in the right-hand position.

In the case of an external power supply, the BigAVR 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 J14 should be set in the left-hand position. In Fig. 7 you can see

USB and external power supply connectors.

Figure 8.

Power supply select jumper

Figure 7.

USB and power supply connectors

J14 in the left-hand position: system will take power from the external AC/DC power adapter.

J14 in the right-hand position: system will take power from the

USB cable.

USB connector

External power supply connector

CN24

1

2

8-16V (AC/DC)

+

EXT

EXT

USB USB Power Suppl y

USB

External Power Supply

E1

470uF

REG1

7805

1

C1

100nF

Vin

GND

Vout

2

3

5V

EXT

C2

100nF

J14

USB

FP1

E2

470uF

C3

100nF

5V

VCC

D-

D+

GND

USB

Figure 9.

Power supply schematic

BigAVR

with

USB 2.0 PROGRAMMER

VCC

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 page

BigAVR User’s Manual MikroElektronika

Development tools

ON-BOARD USB 2.0 PROGRAMMER

There is no need for the use of external equipment during programming, as the BigAVR 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 AVRFlash programming software, which is supplied with the board.

Figure 10.

On-Board USB programmer

Note: There is no need for manually reseting MCU after programming. The programmer will reset the MCU automatically.

Figure 11.

PE0, PE1 and PB1 used as programming lines (Default)

J20

J21

Figure 12.

PB2, PB3 and PB1 used as programming lines

J20

J21 page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

There are two different AVR MCU groups. The first one (Default) uses special pins for programming: PDI (PE0 pin), PDO (PE1 pin) and SCK (PB1 pin). The second one uses SPI communication lines for programming: MOSI (PB2 pin), MISO (PB3 pin) and SCK (PB1 pin).

With jumpers J20 and J21 you can select which pins will be used for programming (acording to the MCU type).

VCC

POWER

VCC

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

ATmega128

PC4

PC3

PC2

PC1

PC0

PG1

PG0

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

C1

22pF

X1

10MHz

C2

22pF

J20

J21

VCC

USB LINK

U3

VCC

27

27

VCC

1

2

3

4

CN18

VCC

D-

D+

GND

USB

USB CONN.

TO PERIPHERALS

ON DEVELOPMENT BOARD

Figure 13.

Programmer schematic

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

OSCILLATOR

BigAVR development board has on-board oscillator circuit for generating microcontroller’s clock input and also crystal oscillator placed on MCU Card. Within the AVRFlash programmer you can either choose internal RC oscillator, external clock or external crystal. With jumper J1 (placed on MCU Card) you can choose which clock will be used to drive MCU: external oscillator or crystal.

VCC

VCC

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

J1

OSCILLATOR

Oscillator

Figure 14.

A

74HC04

VCC

F

B

E

C

D

GND

VCC

R11

1K

R10 1M

X2

8MHz

C1

22pF

X1

10MHz

C2

22pF

External crystal selected

External oscillator selected

Figure 15.

Oscillator schematic page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

LEDs

Light Emitting Diodes (LEDs) are the most commonly used components, usually for displaying pin’s digital state. BigAVR has 86 LEDs that are connected to the microcontroller’s

PORTA, PORTB, PORTC, PORTD, PORTE, PORTF, PORTG, PORTH, PORTJ, PORTK and PORTL.

Figure 16.

Light Emitting Diodes

Each group of LEDs can be enabled or disabled using the switches SW1 and SW2. Fig. 17.

illustrates the connection of a LEDs to PORTF 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.

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

The LEDs are enabled when the corresponding switch on SW1 and 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.

SW1

PORTA LED

PORTB LED

PORTC LED

PORTD LED

PORTE LED

PORTF LED

PORTG LED

PORTH LED

SW2

PORTJ LED

PORTK LED

PORTL LED

RN20

RPACK8/9

8x1K

1

4

5

2

3

6

7

8

9

PF4

PF3

PF2

PF1

PF0

PF7

PF6

PF5

LED schematic

Figure 17.

CURRENT FLOW

VCC

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

VCC

C1

22pF

X1

10MHz

C2

22pF page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

PUSHBUTTON SWITCHES

BigAVR has 86 push buttons, which can be used to change states of digital inputs to microcontroller's ports. There is also one switch that acts as a RESET. Reset switch schematic is shown in Figure 18.

Figure 18.

Reset switch schematic

VCC

BigAVR User’s Manual

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

ATmega128

PC4

PC3

PC2

PC1

PC0

PG1

PG0

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

Pushbutton switches

Figure 20.

VCC

C1

22pF

X1

10MHz

C2

22pF

AVRFlash

On-Board USB programmer

Figure 19.

Reset switch

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

Buttons connections to PORTC is shown in Fig. 21. Jumper J12 determines whether a button press will bring logical zero or logical one to the appropriate pin.

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

In the example shown in Fig. 21, J12 is connected to +5V, therefore pressing the buttons will bring logical one to the appropriate pins.

PORTC

PC0

PC5

PC6

PC7

PC1

PC2

PC3

PC4

VCC

J12

5V while button is pressed

0V while button is pressed

VCC

VCC

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

C1

22pF

X1

10MHz

C2

22pF

Buttons schematic

Figure 21.

page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

On Fig. 22 the J3 jumper is set to pull-up, therefore when the button is not pressed, pull-up resistor pulls the microcontroller’s

PC2 pin to +5V.

A button press causes the port pin to be connected to ground (J12 is in the lower position).

Thus, only when the button is pressed the microcontroller will sense a logical zero; otherwise the pin state will always be logical one.

VCC

VCC

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

C1

22pF

X1

10MHz

C2

22pF

PORTC

J3 vcc pull-up

PC2 vcc

J12

0V while pressed

Figure 22.

Button with pull-up resistor

On Fig. 23 the J3 jumper is set to pull-down, therefore when the button is not pressed, pull-down resistor pulls the microcontroller’s

PC2 pin to 0V.

A button press causes the port pin to be connected to

+5V (J12 is in the higher position).

Thus, only when the button is pressed the microcontroller will sense a logical one; otherwise the pin state will always be logical zero.

VCC

VCC

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

C1

22pF

X1

10MHz

C2

22pF

PORTC

J3 vcc pull-down

PC2 vcc

J12

5V while pressed

Figure 23.

Button with pull-down resistor

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

GRAPHIC LCD

CONNECTOR

GRAPHIC LCD

A graphic LCD (GLCD) allows advanced visual messages to be displayed. While a character LCD can display only alphanumeric characters, a GLCD can be used to display messages in the form of drawings and bitmaps.

The most commonly used graphic LCD has the screen resolution of 128x64 pixels. Before a GLCD is connected, the user needs to set the jumper J17 (Fig. 25) to the upper position.

The GLCD’s contrast can be adjusted using the potentiometer P3, which is placed to the right of the GLCD.

page

Figure 24.

GLCD

NOTE:

Make sure to turn off the power supply before placing GLCD on development board! If the power supply is connected while placing, GLCD unit can be permanently damaged!

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

In order to enable GLCD, jumper J17 should be set to the upper position, labeled as GRAPH.

GRAPH.

J17

CHAR.

Vee

VCC

Contrast

Adjustment

P3 10K

Vo

VCC

1

Figure 25.

GLCD schematic

GLCD contrast selected

LCD8 contrast selected

GLCD and LCD8 contrast not selected

VCC

20

R16 10

VCC

CS1

CS2

RS

R/W

E

RST

PE6

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

D3

D4

D5

D6

D7

VCC

C1

22pF

X1

10MHz

C2

22pF

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

LCD 2X16 IN 4-BIT MODE

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 pixels. 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 BigAVR development board.

For 4-bit data bus use, the LCD should be placed in the upper left of the board, above the

LEDs. The connection to the microcontroller is shown in Fig. 27 where there are only four data lines.

Figure 26.

LCD 2x16 in 4-bit mode

NOTE:

Make sure to turn off the power supply before placing GLCD on development board! If the power supply is connected while placing, GLCD unit can be permanently damaged!

page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

Figure 27.

LCD 2x16 in 4-bit mode schematic

VCC

P4

10K

Contrast

Adjustment

Vo

1 14

LCD Display

4-bit mode

BigAVR User’s Manual

VCC

VCC

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

ATmega128

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

D7

D6

D5

D4

E

RS

C1

22pF

X1

10MHz

C2

22pF

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

LCD 2X16 IN 8-BIT MODE

When using a character LCD in 8-bit mode, the connector that is shared with the GLCD should be used. Since this connector has 20 pins and the character LCD has only 14 pins, special attention is required when placing the LCD. Otherwise the LCD can be permanently damaged.

Figure 28.

LCD 2x16 in 8-bit mode

View from the back: shows which pins stays disconnected.

NOTE:

Make sure to turn off the power supply before placing GLCD on development board! If the power supply is connected while placing, GLCD unit can be permanently damaged!

NOTE:

Make sure to place the LCD properly! Improper placement may damage the LCD unit permanently!

page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

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

BigAVR only when the power is off. Before attaching the LCD, set jumper J17 to the lower position. The LCD's contrast can be adjusted using potentiometer P3 which is located to the right of the GLCD/LCD connector.

In order to enable LCD, jumper J17 should be set to the lower position, labeled as CHAR.

GRAPH.

J17

CHAR.

Vee

VCC

Contrast

Adjustment

P3 10K

Vo

VCC

Leave two free pins to the left side

GLCD contrast selected

LCD8 contrast selected

GLCD and LCD8 contrast not selected

Leave four free pins to the right side

1 14

LCD Display

8-bit mode

RS

R/W

E

VCC

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

ATmega128

PC4

PC3

PC2

PC1

PC0

PG1

PG0

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

D3

D4

D5

D6

D7

Figure 29.

LCD 8-bit mode schematic

VCC

C1

22pF

X1

10MHz

C2

22pF

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

RS-232 COMMUNICATION

RS-232 communication enables point-to-point data transfer. It is commonly used in data acquisition applications, for the transfer of data between the microcontroller and a PC. Since the voltage levels of a microcontroller and PC are not directly compatible with each other, a level transition buffer such as the MAX232 must be used.

Figure 30.

RS232 connectors

In order to provide a more flexible system, the microcontroller is connected to the MAX232 through the switches 1, 2, 3, and 4 on SW3 for the RS232-A port and the switches 5,6,7 and

8 on SW3 for the RS232-B port. Rx and Tx lines for the RS232-A port are connected to PE0 and PE1 pins, respectively. Rx and Tx lines for the RS232-B port are connected to PD2 and

PD3 pins, respectively. Both RS232 ports have RTS and CTS lines for implementing hardware handshaking.

page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

Figure 31.

Connection between microcontroller and a PC: RS232-A

PC

RS232

CON

1

6 9

5

CONNECT

MCU TO PC

SERIAL

CABLE

RS232-A

CON

1

6 9

5

VCC

E3

10uF

E5

10uF

1

2

3

4

5

6

7

8

C10

100nF

E6

10uF

C1+

VS+

C1-

C2+

C2-

VS-

T2OUT

R2IN

U1

VCC

GND

T1OUT

R1IN

R1OUT

T1IN

T2IN

R2OUT

12

11

10

9

16

15

14

13

VCC

E4

10uF

CONNECT

PC TO MCU

CN25

SUB-D 9p

SW3

Receive data (Rx)

RTS

CTS

Send

Data (Tx)

Rx

Tx

RTS

CTS

VCC

VCC

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

ATmega128

PC4

PC3

PC2

PC1

PC0

PG1

PG0

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

C1

22pF

X1

10MHz

C2

22pF

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

Figure 32.

Connection between microcontroller and a PC: RS232-B

PC

RS232

CON

1

6 9

5

CONNECT

MCU TO PC

Receive data (Rx)

RTS

CTS

SERIAL

CABLE

RS232-B

CON

1

6 9

5

VCC

E7

10uF

E9

10uF

1

2

3

4

5

6

7

8

C11

100nF

E10

10uF

C1+

VS+

C1-

C2+

C2-

VS-

T2OUT

R2IN

U1

VCC

GND

T1OUT

R1IN

R1OUT

T1IN

T2IN

R2OUT

12

11

10

9

16

15

14

13

VCC

E8

10uF

CONNECT

PC TO MCU

CN26

SUB-D 9p

SW3

Send

Data (Tx)

VCC

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

ATmega128

PC4

PC3

PC2

PC1

PC0

PG1

PG0

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

VCC

Rx

Tx

RTS

CTS

C1

22pF

X1

10MHz

C2

22pF page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

DS1820 DIGITAL THERMOMETER

DS1820 digital thermometer is well suited to environmental temperature measurement, having the temperature range of -55°C to 125°C and the accuracy of +/-

0.5°C. It must be placed correctly in the 3-pin socket provided on BigAVR, with its rounded side to the upper edge of the board (see Fig. 33) otherwise the

DS1820 could be permanently damaged. DS1820’s data pin can be connected to PG0 pin by enabling switch 4 on SW2.

DS1820

VCC

Figure 33.

There is a mark in the form of half-circle for proper orientation of

DS1820 sensor.

125 C

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

ATmega128

PC4

PC3

PC2

PC1

PC0

PG1

PG0

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

DS1820

-50 C

VCC

VCC

C1

22pF

X1

10MHz

C2

22pF

VCC

SW2

R1

10K

GND VCC

DQ

Figure 34.

DS1820 schematic

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

A/D CONVERTER INPUT

BigAVR development board has two potentiometers for working with A/D Converter

(Analog-to-Digital Converter). Both potentiometers outputs are in the range of 0V to 5V.

Two analog signals can be connected on two different analog input pins at the same time.

The jumpers group J18 enables connection between potentiometer P1 and one of the following pins: PF0, PF1, PF2, PF3 or PF4. The jumpers group J19 enables connection between potentiometer P2 and one of the following pins: PF1, PF2, PF3, PF4 or PF5.

Figure 35.

A/D Converter input

In order to measure analog signal without interference, turn the coresponding switch on

SW4 to OFF position. This will disable connection of the used PORTF pin to the pullup/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 AVR. That range is 0V to 5V.

page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

pull-up/down

PORTF vcc

J6

P1

10K vcc

0 - 5V

0 - 5V

P2

10K vcc

0 - 5V

J18

J19

ON

vcc

1 2

3 4 5 6 7 8

vcc

REF1

MCP

1541

VIN

1

GND 2

3 VOUT

R12

100

J13

R13

1K

AREF

E11

10uF

VCC

Figure 36.

A/D Converter input schematic

Potentiometer P1 is connected to RF2 pin and potentiometer P2 is connected to RF3 pin.

NOTE:

Jumpers J18 and J19 should not select the same pin.

VCC

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

C1

22pF

X1

10MHz

C2

22pF

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual

VCC

MikroElektronika

Development tools

PS/2 (KEYBOARD) CONNECTOR

The PS/2 connector allows direct connection between BigAVR and devices that use

PS/2 communication, such as PC, keyboard or mouse. For example, the microcontroller can be connected to a keyboard to capture pressed keys or it can be connected to a PC to act as a keyboard. CLK and DATA lines are used for data tansfer. In this case, they are connected to pins PC1 and PC0 respectively.

VCC

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

PS/2 connector

Figure 37.

Figure 38.

Keyboard connected to development board

VCC VCC

R26

10K

R25

10K

J16 J15

VCC

PS2

CONNECTOR

DATA

NC

GND

VCC

CLK

NC

NC

+5V

NC

CLK

DATA page

C1

22pF

X1

10MHz

C2

22pF

Figure 39.

PS/2 communication schematic

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

DIRECT PORT ACCESS

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, PORTE, PORTF,

PORTG, PORTH, PORTJ, PORTK and PORTL there is one 10-pin connector providing

VCC, GND and up to eight port pins.

Direct port access connectors

Figure 40.

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 and switches, while external peripherals are using the same pins. The connectors can also be used for attaching logic probes or other test equipment.

Figure 41.

Example of how to connect external peripheral with flat cable

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

VCC

J1

VCC

Pull-up line is connected

1

PA7 2

PA6

PA5

PA4

3

4

5

PA3

PA2

PA1

PA0

6

7

8

9

RN1

RPACK8/9

8x10K

Pull-down line is connected

All lines are disconnected

PA0

PA2

PA4

PA6

CN1

PA1

PA3

PA5

PA7

VCC

HEADER 5x2

VCC

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

C1

22pF

X1

10MHz

C2

22pF

Figure 42.

PORTA connection page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

JTAG CONNECTOR

JTAG connector can be used as serial programming interface or On-Chip debug system. For the On-chip Debug system, in addition to the JTAG interface pins, the RESET pin is monitored by the debugger to be able to detect external reset sources. The debugger can also pull the RESET pin low to reset the whole system. The JTAG interface is accessed through four of the microcontroller’s pins:

- TMS: Test Mode Select,

- TCK: Test Clock,

- TDI: Test Data In,

- TDO: Test Data Out.

Figure 43.

JTAG connector schematic

PB0

PB1

PB2

PB3

PB4

PB5

PB6

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

VCC

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

VCC

JTAG

CONNECTOR

CN13

TCK GND

TDO

TMS

Vsupply

TDI

VTref nSRST nTRST

GND

VCC

mRST

NC

HEADER 5x2

VCC

C1

22pF

X1

10MHz

C2

22pF

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

256MB

MMC/SD (MULTIMEDIA CARD)

MMC card is used as storage media for a portable devices, in a form that can easily be removed for access by a PC. For example, a digital camera would use an MMC card for storing image files. With an MMC reader (typically small box that connects via USB or some other serial connection) you can easily transfer data from MMC card to your computer. Microcontroller on BigAVR communicates with Multi Media Card via SPI communication.

Modern computers, both laptops and desktops, often have SD slots, which can read MMC cards.

Figure 44.

MMC slot on-board

To enable MMC card you must turn on switches 5, 6, 7 and 8 on SW2. By doing that, microcontroller’s SPI comunnication lines (SDI, SDO and SCK) and Chip Select are connected to

MMC. Working voltage of BigAVR 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 45.

page

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

BigAVR

with

USB 2.0 PROGRAMMER

MikroElektronika

Development tools

BigAVR User’s Manual

SPI-SDI

MMC-CS#

SPI-SDO

SPI-SCK

VCC3

R17

2K2

R19

2K2

R21

2K2

R18

3K3

R20

3K3

R22

3K3

VCC3

C13

100nF

VCC

REG2

MC33269

DT-3.3

VCC

C12

100nF

1

GND

2

3

VIN

VOUT

VCC3

E16

10uF

SW2

1

2

3

4

5

6

7

CS

Din

GND

+3.3V

SCK

GND

Dout

CN22

MMC/SD

CARD

VCC

MMC-SDI

MMC-SDO

MMC-SCK

MMC-CS#

PB3

PB2

PB1

PG1

PEN

PE0

PE1

PE2

PE3

PE4

PE5

PE6

PE7

PB0

PB1

PB2

PB3

PB4

PB5

PB6

ATmega128

PA3

PA4

PA5

PA6

PA7

PG2

PC7

PC6

PC5

PC4

PC3

PC2

PC1

PC0

PG1

PG0

VCC

C1

22pF

X1

10MHz

C2

22pF

MMC schematic

Figure 45.

BigAVR

with

USB 2.0 PROGRAMMER

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 page

BigAVR User’s Manual MikroElektronika

Development tools

If you are experiencing problems with any of our products or you just want additional information, please let us know. We are committed to meeting your every need.

Technical Support :

[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/

page

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

BigAVR

with

USB 2.0 PROGRAMMER

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