You are on page 1of 40

www.rhydolabz.

com

eCee AVR AT Mega32/32L


Development Board
User Manual

Rhydo Technologies (P) Ltd.


(An ISO 9001:2008 Certified R&D Company)
Golden Plaza, Chitoor Road,
Cochin – 682018, Kerala State, India
Phone : 0091- 484-2370444, 2371666
Cell : 0091- 99466 70444
Fax : 0091 - 484-2370579
E-mail : info@rhydolabz.com, sales@rhydolabz.com
WebSite : http://www.rhydolabz.com

We bring the world to you..


www.rhydolabz.com

CONTENTS

OVERVIEW
FEATURES
PACKAGE CONTENTS
MICROCONTROLLER SPECIFICATION
INTERFACE OVERVIEW
POWER SUPPLY
CLOCK SOURCE
MICROCONTROLLER - PIN OUT
PORT PINS
UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER (USART)
LED INTERFACING
LCD INTERFACING
MATRIX KEYBOARD INTERFACING
PULLUP KEYBOARD INTERFACING
BUZZER INTERFACING
ADC INTERFACING
EXTERNAL INTERRUPT
EXTERNAL EEPROM INTERFACING
RTC INTERFACING
7 SEGMENT MODULE INTERFACING
IR SENSOR INTERFACING
SETTING UP eCee AT Mega32/32L
PROGRAMMING STEPS

We bring the world to you..


www.rhydolabz.com

The eCee AVR AT Mega32 Evaluation Board allows you to generate and test application
programs for the AVR AT Mega32 microcontroller family. With this hands-on process, you can
determine hardware and software components required for product development. The eCee AVR AT
Mega32 Board contains all hardware components that are required in a single-chip AT Mega32
controller system plus 1 COM ports for serial RS232 interface.

FEATURES

 Compact and Ready to use design


 Professional EMI/RFI Complaint PCB Layout Design for Noise Reduction
 High Quality Two layer PTH PCB
 Includes AVR AT Mega 32 Microcontroller with 8 MHz
 Board Supports AVRMega32/16L/32/32L/8535 Microcontrollers
 No separate programmer required (Built in Boot loader)
 No Separate power adapter required (USB power source)
 Screw terminal for External power Supply (with Jumper Select Option)
 External Power Supply range of 7V to 20V
 Adaptor (any standard 9-12V power supply) option
 RS-232 Interface (For direct connection to PC’s serial port)
 On board Two Line LCD Display (2x16)
 On board TWI EEPROM (4K-AT24C04)
 On board TWI RTC (DS 1307) with Crystal and Battery
 On board 32.768 KHz Crystal for RTC
 Four multiplexed 7-Segment LED Display
 Built in Matrix keyboard (12 keys)
 Built in Pull-Up (4 Keys) Keyboard
 Built in IR Sensor Interface – TSOP 1738
 Built in 8 LED Interface to test I/O
 On Board External Interrupt and Reset buttons
 Built in Potentiometer interface for ADC with variable reference voltage input

We bring the world to you..


www.rhydolabz.com

 On Board Temperature Sensor Interface


 On Board Buzzer Interface
 On Board PWM Output pin
 On Board JTAG Connector for Debugging/Programming
 On Board ICSP Connector
 On Board 8 MHz Crystal Oscillator
 On Board Power LED Indicator
 On Board DB9 Connector
 On Board USB Connector
 All Port Pins available at IDC (2x5) Connector
 Power Supply Reverse Polarity Protection
 On Board 1 Amp Voltage Regulator
 Can be used as main board for developing applications
 Demo HEX codes included for testing of board features
 Example codes included

eCee AT Mega 32 PACKAGE INCLUDES

 Fully Assembled and Tested eCee AVR AT Mega 32 Development board


 Software CDROM with
o Schematic
o Programming Software
o Sample Hex Code
o Example Codes for

 Led Blinking LCD Display


 Matrix Keyboard Pull-Up Keyboard
 7-Segment Display External Interrupt Handling
 EEPROM Writing EEPROM Reading
 PWM Generation RTC Interfacing
 ADC Interfacing UART Transmission of Temperature

We bring the world to you..


www.rhydolabz.com

AT Mega32 SPECIFICATION

 Atmel AVR AT Mega 32 with 8 MHz Crystal Oscillator (With Boot loader Software)
 High Performance RISC CPU
 131 Powerful Instructions – Most Single-clock Cycle Execution
 On-chip 2-cycle Multiplier
 32 K bytes programmable flash
 2 K bytes SRAM
 1024 bytes EEPROM
 Upto16 MHz operation (Up to 16MIPS for ATMega32)
 Internal Calibrated RC Oscillator
 32 I/O pins
 8 channel 10 bit ADC
 On-chip Analog Comparator
 4 PWM Channels
 4 Compare modules associated with each Timer
 Two 8-Bit Timer/Counter
 One 16-Bit Timer/Counter
 Real Time Counter with Separate Oscillator
 One Serial USART
 1 Two Wire Serial Interface TWI Module
 One Serial Peripheral Interface(SPI - Master/ Slave) Module
 Power Consumption ~ 15mA
 Power-On Reset (POR), Power-Up Timer (PWRT) and Oscillator Start-up Timer (OST)
 Interrupt Capability (up to 20 sources)
 32 x 8 General Purpose Working Registers
 ICSP Programming
 JTAG (IEEE std. 1149.1 Compliant) Interface
 Brown Out Reset
 Low Voltage Programming

We bring the world to you..


www.rhydolabz.com

 Power Saving Sleep Mode


 Programmable Code Protection
 Optional Boot Code Section with Independent Lock Bits
 Fully Static Design
 Wide Operating Voltage 2.7V to 5.5V
 Low Power Consumption

FUNCTION MODULE

We bring the world to you..


www.rhydolabz.com

INTERFACE OVERVIEW

7- SEGMENT ENABLE LCD CONTRAST LCD ENABLE BUZZER RTC IC- DS1307
DIP SWITCHES ADJUST DIP SWITCHES

LCD RTC CRYSTAL MAX 232 SERIAL INTERFACE


7- SEGMENT (DB9 CONNECTOR)
DISPLAYS

IR SENSOR EXTERNAL EEPROM

LED ARRAY EXTERNALPOWER


7-20V DC

LED ENABLE
DIP3 SWITCHES REGULATOR IC

PULL-UP DC ADAPTER
KEY BOARD SOCKET

USB SOCKET
ATMEGA32

SUPPLY SELECT
CRYSTAL ( USB OR DC)
OSCILLATOR
8 MHz
RESET SWITCH

3 X 4 MATRIX
KEY BOARD EXTERNAL
INTERRUPT SWITCH

ISP CONNECTOR PORTB IDC PORTA IDC PORTD IDC LM35- TEMPERATURE SENSOR

ADC VREF INPUT JTAG CONNECTOR PORTC IDC ADC INPUT

We bring the world to you..


www.rhydolabz.com

PERIPHERALS DESCRIPTION

USB(K1)
USB Socket

Power Choose(USB AND DC)


K2

USART Interface via Female DB9 Connector


K3

Screw Terminal(DC Socket)


K4

PWM Terminal
K5

JTAG
K8

AT Mega 32 IC
U1

MAX232(Level converter)
U2

LM7805(Regulator IC(5V))
U3

EEPROM(24C04)
U4

Temperature Sensor (LM35)


U5
BUZZER
U6
U7
RTC(DS1307)

S1
IR Sensor

LCD1
LCD Module, HD44780U

B1
Battery for RTC(3V)

Y1
Crystal (8MHz)

We bring the world to you..


www.rhydolabz.com

Y2
Crystal for RTC (32.768KHz)

SW1-SW12
Matrix Keypad switches
RESET(SW13)
Reset Key

SW14-SW17
Pull-Up Switches

LED1-LED8
Light Emitting Diodes

INT
External Interrupt key

DISP1-DISP4
7 Segment Display modules

CONTRAST(P1)
LCD Contrast Adjust through Pot

IDC1
PORTB pins are available on 5x2 IDC

IDC2
PORTC pins are available on 5x2 IDC

IDC3
PORTD pins are available on 5x2 IDC

IDC4 PORTA pins are available on 5x2 IDC

ISP
To program the IC

ADC(P3)
Potentiometer As ADC input

Vref(P2)
Potentiometer to provide variable reference voltage to ADC

J1
Adaptor socket

We bring the world to you..


www.rhydolabz.com

Jumper no Description Set option Set description


1-2 DC Power is selected,
k2
Supply Select 2-3 USB Power is selected

LCD Light LCD Light Short to access LCD backlight ON


LM35 Access via
TEMP TEMP Short to access
PA5(channel 5)

Potentiometer Output

ADC ADC Short to access connected to PA6


input(channel 6)

Clock pin of EEPROM


EEPROM,RTC could be
SCL and RTC Short to access
accessed

Data pin of EEPROM


EEPROM,RTC could be
SDA and RTC Short to access
accessed

BZ Buzzer Short to access Buzzer could be accessed

External interrupt 0 could


J6 External Interrupt Short to access
be accessed
IR sensor could be
J3 IR Short to access
accessed

We bring the world to you..


www.rhydolabz.com

POWER SUPPLY

Atmel eCee AVR AT Mega 32 Board has three power supplies; you can choose one of the following
ways to supply power

(1) Through an Adaptor (any standard 9-12V power supply)


(2) Through the USB port
(3) Through the DC socket (7-20V power supply)

The external Power Supply circuit is given below:

POWER SUPPLY
K1
+5
1 K2
D-
2
VCC 3
3 2
D+
4 1
GND
POWER SELECTION
USB
U3
R4
K4 D1 LM7805
1K
+12V 1 3
2 Vin Vout
GND

GND 1 1N4007
47MF

J1 DC SOCKET
ADAPTOR C28
C20
2

470MF C21 C22 D2


0.1MF 0.1MF
PWR

CLOCK SOURCE

eCee AVR AT Mega 32 board uses:


 8 MHz Crystal as the MCU clock source
 32.768 KHz Crystal as the RTC clock source

We bring the world to you..


www.rhydolabz.com

MICROCONTROLLER - PIN OUT

+5

R1
10K
SW13 U1
R571K
RST 9 8 PB7
RST PB7/SCK
XTL2 12 7 PB6
RESET XTL2 PB6/MISO
Y1 6 PB5
PB5/MOSI
XTL1 13 5 PB4
XTL1 PB4/SS
AREF 32 4 PB3
AREF PB3
16MHz 3 PB2
PB2
C6 C11 C12 AVCC 30 2 PB1
AVCC PB1
0.1MF 22PF 22PF 1 PB0
PB0
+5 GND 31
GND
10 29 PC7
VCC PC7
11 28 PC6
GND PC6
C15 27 PC5
PC5
26 PC4
PC4
0.1MF PA7 33 25 PC3
PA7/ADC7 PC3/TMS
PA6 34 24 PC2
PA6/ADC6 PC2/TCK
PA5 35 23 PC1
PA5/ADC5 PC1/SDA
PA4 36 22 PC0
PA4/ADC4 PC0/SCL
21 PD7
PD7
20 PD6
PD6/ICP
19 PD5
PD5
PA3 37 18 PD4
PA3/ADC3 PD4
+5 PA2 38 17 PD3
PA2/ADC2 PD3/INT1
AVCC PA1 39 16 PD2
PA1/ADC1 PD2/INT0
PA0 40 15 PD1
PA0/ADC0 PD1/TXD
14 PD0
PD0/RXD
C34
0.1MF
ATMEGA32

We bring the world to you..


www.rhydolabz.com

PORT PINS - 5x2 IDC CONNECTOR


ED
The eCee AVR AT Mega 32 board has all port pins available at 5X2 IDC. The connection is as given
below.

PORTA +5
PORTB +5

C4
0.1MF IDC1 C1
IDC4 PB0
PA0 1 2 0.1MF
1 2 PB1
PA1 3 4
3 4 PB2 PB7
PA2 PA7 5 6
5 6 PB3 PB6
PA3 PA6 7 8
7 8 PB4 PB5
PA4 PA5 9 10
9 10
IDC 5X2
IDC 5X2

PORTC +5
PORTD +5

C2
IDC2 0.1MF C3
PC0 IDC3 0.1MF
1 2 PD0
PC1 1 2
3 4 PD1
PC2 PC7 3 4
5 6 PD2 PD7
PC3 PC6 5 6
7 8 PD3 PD6
PC4 PC5 7 8
9 10 PD4 PD5
9 10
IDC 5X2
IDC 5X2

ISP CONNECTION

+5

ISP 1
MOSI/ PB5
1 2
3 4
RST
5 6
SCK/ PB7
7 8
MISO/ PB6
9 10
IDC 5X2

We bring the world to you..


www.rhydolabz.com

JTAG CONNECTION

K8
TCK, PC2 +5
1 2
+5 TDO, PC4
3 4
TMS, PC3 RST
5 6
7 8
TDI, PC5
9 10

JTAG

UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER (USART)

The AVR AT Mega32 USART module operates through PD1 (TXD) and PD0 (RXD) pins.

+5
16
1

C18
C8
C16 U2 1MF/16V
0.1MF
1MF/16V 2
C1

VCC

V+
3
C1-
6
V-
4
C2+
1mf/16v C19
C17 K3
1MF/16V 5
5 9
C2-
4
R6 1K
PD0 9 8 8
R2OUT R2IN
3
GND

PD1 10 7 7
T2IN T2OUT
R5 2
1K
6
MAX232 1
15

DB9F

The AVR AT MEGA 32 USART output itself operates at CMOS voltages, and needs an external
serial line driver to convert its output into a higher symmetrical line voltage. The MAX 232 serial
driver serves this purpose.

We bring the world to you..


www.rhydolabz.com

CREATING HYPERTERMINAL IN PC

The serial data transmitted through USART can be viewed on a PC using a Windows tool for
Serial Port Communication called HyperTerminal.

We bring the world to you..


www.rhydolabz.com

We bring the world to you..


www.rhydolabz.com

Now Disconnect the Hyper Terminal. Then open the Property from ‘File’.

Disconnect

Connect
HyperTerminal

We bring the world to you..


www.rhydolabz.com

Select File  Save As  Desktop

We bring the world to you..


www.rhydolabz.com

LED INTERFACING

LED’s are the simplest devices to test port functioning. The board contains 8 LED’s connected to
PORTC of the AVR Mega32.

LED INTERFACING
D3 LED1
R14 470R
PC0
D5 LED2
R48 470R
PC1
DIP3
R49 470R D4 LED3
PC2 1 16
2 15
R50 470R
PC3 3 14
D6 LED4
4 13
R51 470R
PC4 5 12
6 11
R52 470R D8 LED5
PC5 7 10
8 9
R53 470R
PC6
DIP 8 WAY D7 LED6
R54 470R
PC7

D10 LED7

D9 LED8

LCD - LIQUID CRYSTAL DISPLAY

The display is a standard 16x2 LCD which displays 2 lines of 16 characters. Each
character is 40 pixels, making it 1280 pixels overall. The display receives ASCII codes for each
character at the data inputs (D0–D7). The data is presented to the display inputs by the MCU, and
latched in by triggering the E (Enable) input. The RW (Read/Write) line can be tied low (write mode),
as the LCD is receiving data only. The RS (Register Select) input allows commands to be sent to the
display. RS selects command/data mode. The display itself contains a microcontroller; the standard
chip in this type of display is the Hitachi HD44780. It must be initialized according to the data and
display options required. The module can be used 4-bit or 8-bit mode. The development board uses 8-
bit interface. PORTB pins are used for data/command pins and PORTD for RS, RW, E pins.

We bring the world to you..


www.rhydolabz.com

C7 C13 P1
0.1MF 4K7
10MF
LCD1
1
LCD-
PWR 2
LCD+
+5
DIP1 DIP 4 WAY 3
CON
1 8 4
RS
PD4 2 7
5
PD5 3 6 R/W
PD6 4 5 6
E
7
DIP2 D0
PB0 1 16 8
D1
PB1 2 15
9
PB2 3 14 D2
PB3 4 13 10
D3
PB4 5 12
11
PB5 6 11 D4
PB6 7 10 12
D5
PB7 8 9
13
D6
DIP 8 WAY 14
D7
PWR 15
J7 LED+
16
LED-
330R
LCD LIGHT R2

LCD 16X2

MATRIX KEYBOARD

A keypad is simply an array of push buttons connected in rows and columns, so that each can
be tested for closure with the minimum number of connections. There are 12 keys on a phone type pad
(0–9, A-B), arranged in a 4X3 matrix. Assume the columns are labeled 1, 2, 3, 4 and the rows A, B, C.
If we assume that all the rows and columns are initially high, a keystroke can be detected by setting
each row to low in turn and checking each column for a zero. In the KEYPAD circuit the 3 keypad
row selection pins are connected to PORTC and Column lines are connected to PORTA. Pins PC5-
PC7 are initialized as outputs and pins PA4-PA7 are used as inputs. These input pins are pulled high to
logic 1. The output rows are also initially set to 1.

We bring the world to you..


www.rhydolabz.com

SW1 SW4 SW7 SW10

SWITCH SWITCH SWITCH SWITCH R20


PC5

SW2 SW5 SW8 SW11 330R

SWITCH SWITCH SWITCH SWITCH R21


PC6
330R
SW3 SW6 SW9 SW12

SWITCH SWITCH SWITCH SWITCH R22 330R


PC7

R32 330R
PA4

R33 330R
PA5

R31 330R
PA6

R34
PA7
330R

PULL UP KEYBOARD

The simplest input is a switch or push button. This can operate with just one additional support
component, a pull-up resistor, but there are still some significant issues to consider, such as input
loading and de-bouncing.

PULL-UP KEYBOARD
+5

R38 R39 R40


R37

SW14
R11 4K7 4K7 4K7 4K7
PD4
SWITCH 1K

SW15
R12
PD5
SWITCH 1K

SW16
R15
PD6
SWITCH 1K

SW17
R16
PD7
SWITCH 1K

When the switch is open, the output voltage of the circuit is pulled up to 5V via the resistor.
There are 4 pull up switches in the board connected to four PORTD bits; 4, 5, 6 and 7. User can
access the switch status, by simply reading the PIND register.

We bring the world to you..


www.rhydolabz.com

BUZZER INTERFACING

Interfacing a buzzer is a simple I/O operation. Normally we use piezo electric devices as buzzer.
Buzzer is driven using a simple NPN transistor with a biasing. The transistor’s base is connected to the
I/O port of the microcontroller. If the port pin is configured as an output port and a logical high is
given to that port, the transistor will triggered on and which in turn switch on the Buzzer.

BUZZER

+5

U6
10MF
C29

BELL

Q5 J5
BC547 R46
PD3
2K2
R55 BUZ
10k

In our development board Buzzer driving is made possible through the I/O pin PD3 (PORTD’s third
pin). In order to sound the buzzer the jumper, J5 should be kept in position. When a logical 1 is out
through the PD3 pin, the transistor will turn on and which in turn sound the buzzer. If logical 0 is
provided, the buzzer will be turned off.

We bring the world to you..


www.rhydolabz.com

ADC INTERFACING

eCee AVR AT Mega32 has a 10-bit resolution ADC module.


Steps to Configure ADC without interrupt and transmit the result through USART Software
1) Configure the SFIOR register, so that the free running Trigger source is selected.
2) Select the reference and the Channel 6 using the register ADMUX to select
Potentiometer as ADC input or Select Channel 5 to interface with the Temperature
Sensor.
3) Configure ADCSRA, so that ADC is enabled and no start condition is selected.
4) Initialize USART transmission at 9600 Baud Rate.
5) Enable Start Condition.
6) Wait until conversion completes
7) Read the LSB Result from ADCL first
8) Then Read the MSB Result from ADCH
9) Split the result into digits and transmit through USART

Hardware

1) Place the Jumper J4 (ADC) in position for Potentiometer input or Connect Jumper
(Temp) if you are using Temperature sensor as input. And power the board,
eCeeAVRMega32.
2) Download the program
3) Connect the Serial Port to the computer using serial cable
4) Open Hyper Terminal with baud rate 9600
5) Digital data will be displayed in the hyper terminal

We bring the world to you..


www.rhydolabz.com

TEMPERATURE SENSOR
+5
+5
C24
0.1MF
P3 J4
R19
C10 PA6 U5
1K 1 J2
0.1MF VCC R13
20K ADC 2 PA5
O/P
C27 3
GND 1K
0.1MF TEMP:
LM35 C25
0.1MF

EXTERNAL INTERRUPT

In eCee AVR AT Mega 32 development board, there is a provision for giving external trigger
to the microcontroller through hardware. This key is connected to the 2nd Pin of the PORTD register
(INT0).

INTERRUPT
+5

SW18
INT:

J6 R3
PD2
1K
INT:
R47
10K

We bring the world to you..


www.rhydolabz.com

EXTERNAL EEPROM INTERFACING

The Two-wire Serial Interface (TWI) is ideally suited for interfacing with External EEPROM.
The memory used here is an Atmel 24C04, which stores 4 kb of data and uses a standard TWI
interface. The 4K is internally organized with 256 pages of 2 bytes each. Random word addressing
Chip Number requires a 9-bit data word address. TWI is a more versatile system level serial data
transfer method. It only needs two bus connected signals; clock (SCL) and data (SDA) lines. The
signal lines are pulled up to 5V so that the device connected to it can control the line by pulling it
down; this allows slaves to acknowledge operations initiated by the master.

+5

+5
R35 R36
C23 4K7 4K7 J8
8

PC1
0.1MF
5 SDA SDA
VCC

SDA
1
A0
6 SCL
SCL
2 J9
A1
7 PC0
W
3
A2 SCL
4
GND
U4
24C04

RTC INTERFACING

The DS1307 serial real-time clock (RTC) is a low-power, full binary-coded decimal (BCD)
clock/calendar plus 56 bytes of NV SRAM. The Two-wire Serial Interface (TWI) is ideally suited for
interfacing with RTC.

RTC
+5

C5
0.1MF
8

U7
VCC

1 5 SDA
XTL1 SDA
Y2
2 6 SCL
XTL2 SCL
32.768KHz 7
W
3
GND

C30 C31
33pf 33pf DS1307
B1
4

BATTERY

We bring the world to you..


www.rhydolabz.com

7 SEGMENT MODULE INTERFACING

Each segment is driven separately from PORTB via a current-limiting resistor. There are 4 seven
segment modules in the board. PORTA pins 0,1,2,3 are used to select among the modules.

SEVEN SEGMENT LED INTERFACING


R23
PB0 330R
R24 330R
PB1
R25 330R
PB2 DISP1 DISP2 DISP3 DISP4
R26 330R dp dp dp dp
PB3 A a A a A a A a
B b a B b a B b a B b a
R27
PB4 330R C c f b C c f b C c f b C c f b
D d g D d g D d g D d g
R28
PB5 330R E ee c E ee c E ee c E ee c
F f d F f d F f d F f d
R29 330R
PB6 G g dp G g dp G g dp G g dp
cc

cc

cc

cc
R30 330R
PB7

Q1 Q2 Q3 Q4
DIP4 R7 2K2
BC547 BC547 BC547 BC547
PA0 1 8
R8
PA1 2 7 2K2
PA2 3 6
R9 2K2
PA3 4 5
R10
DIP 4 WAY
2K2

R41 R42 R43


R44
10K

We bring the world to you..


www.rhydolabz.com

IR SENSOR INTERFACING

IR (TSOP) out is connected to the PORTD pin, PD2 through the jumper J3 (IR). In order
to test the IR module, place the Jumper in position. And configure the PD2 as input port.

+5

IR SENSOR
R45
100R

J3 S1
R18
PD2 1
IR
1K
IR 2
VCC
3
GND
C14
10MF C26 TSOP1738
0.1MF

No pull-up is to be enabled to test the IR module. Normally the terminal value of the pin will be active
high. If an IR signal with carrier 38 KHz is received the port terminal value will be pulled low. If you
want to check an RC5 protocol, scan the PIN status in the prescribed interval.

We bring the world to you..


www.rhydolabz.com

USING AVR STUDIO IDE


CREATING A PROJECT

AVR Studio is a standard Windows application and started by clicking on the program icon.
AVR studio includes a project manager which makes it easy to design applications for an AVR based
microcontroller. You need to perform the following steps to create a new project:

 Create Project File


 Select the Project type (Whether Assembly or using winAVR)
 Create New Source Files.
 Add Source Files to the Project.
 Set Configuration Options for Target Hardware.
 Create a HEX File.
 Build Project and Generate Application Program Code.

This section provides a step-by-step tutorial that shows you how to create a simple µVision3 project.

Create Project File and Select CPU

Create Project File Folder and Specify Project Name

To create a new project file select from the AVR


Studio menu Project – Project wizard for the
new AVR project. You should you use a separate
folder for each project.

We bring the world to you..


www.rhydolabz.com

Now select the New Project option. If you want to re-open a pre done project select the
Open option.

Select the Project type (Whether Assembly or using winAVR)

We bring the world to you..


www.rhydolabz.com

Select the AVR Assembler Tool. Now Provide a Project name for our proposed project. You
can provide a specified path to save the project. You can simply use the icon Create New Folder in
this dialog to get a new empty folder.

If the Create Initial file is selected, an .asm file will be created in the same working folder in
the name of the project. And will be added to the project workspace. In that .asm file you can enter
your source code (Recommended). And if the Create Initial file is not selected, simply select the File
– New File option to write the program.

If the Create Folder option is selected, a new folder will be created inside the selected folder
in the name of the project that we provided.

Select the project location, Name the project and Click Next

Select Microcontroller from Device Database


Now Select the Debug tool and the micro controller (From the Device list). Select the debugger
platform as AVR Simulator.

We bring the world to you..


www.rhydolabz.com

While you creating a new project AVR Studio asks you to select a CPU for your project. The
Device section shows the AVR Studio device database. Just select the microcontroller you use. For
example; in this chapter we use the AVR AT Mega 32 controller. This selection sets necessary tool
options for the AVR AT Mega 32 device and simplifies in this way the tool configuration.

Now Select the Finish to complete the project creation.

Create New Source Files

A new source file will be opened after completing the project creation since we select the
option Create Initial File and will be automatically added to the project source files. You can create a
new source file with the menu option File – New unless you deselect the option to Create Initial File
during the project creation. This opens an empty editor window where you can enter your source code.
Save this file in the Working folder, where project file is being saved. AVR Studio enables the color
syntax highlighting when you save your file with the dialog File – Save As… under a filename with
the extension *.asm. We are saving our example file under the name LED_asm.asm.

Add Source Files to Project

Once you have created your source file you can add this file to your project. AVR Studio offers
several ways to add source files to a project. For example, you can select the file group in the Project
Workspace – Files page and click with the right mouse key to open a local menu. The option Add
Files opens the standard files dialog. Select the file LED_asm.asm you have just created.

We bring the world to you..


www.rhydolabz.com

.include"m32def.inc" /* m32 header file included */


.cseg /* code segment selected */
.org $0
rjmp main
main:
ldi r16,0xff /* sets portc as o/p port */
out DDRC,r16
do:
ldi r16,0xFF /* led display on */
out PORTC,r16
rcall delay /* delay for 50 ms */
rcall delay
ldi r16,0x00
out PORTC,r16 /* led display off */
rcall delay /* delay for 50 ms */
rjmp do

We bring the world to you..


www.rhydolabz.com

Set Configuration Options for the Project

AVR studio lets you to set options for your target hardware. The dialog Assembler Options opens via
the Project menu icon. In this option you can specify all relevant and parameters of your target
hardware the on-chip components of the device you have selected. The following dialog shows the
settings for our example.

We bring the world to you..


www.rhydolabz.com

Create HEX File

Once you have successfully generated your application you can start debugging. After you have tested
your application, it is required to create an Intel HEX file to download the software into an EPROM
programmer or simulator. AVR Studio creates HEX files with each build process when Output HEX
File in the Assembler Option is selected as Intel Hex.

Build Project
After Configuring the Device, Build the program that attached to the project as shown in the Fig above
(Press F7). Build option can be taken from the Build Menu. Now the corresponding hex file of the
program will be generated inside the working folder in the name of the project that we created. In this
example the Hex file is LED_asm.HEX. This file will be available in the folder LED_asm.

When you build an application with syntax errors, AVR Studio will display errors and warning
messages in the Output Window – Build page. A double click on a message line opens the source file
on the correct location in the AVR Studio editor window.

We bring the world to you..


www.rhydolabz.com

SETTING UP eCee AVR Mega 32

 Power the demo board by means of a USB connector or from screw terminal.
 Make sure that the Power-On LED is ON and Jumper in proper position.
 Connect the Rs-232 Cable to the COM port of your computer.
 Connect the other end to the RS232 connector of AVR AT Mega 32 board.

PROGRAMMING STEPS

1. Open the AVR Studio (No need to open any project)


2. Press the reset button in eCeeAVRMega32and within 3 Seconds open the ‘AVR Prog’ from Tools
of AVR Studio or Open from (C:\ProgramFiles\Atmel\AVRTools\AvrProg\AvrProg.exe).

We bring the world to you..


www.rhydolabz.com

3. Select the hex file to be downloaded [Eg: D:\LED\LED.hex] using the ‘Browse’ Button and select
the ‘Program’ option to the flash. The Program will be get downloaded to the controller.
4. Reset the AVR-programmer using the RESET switch or Press the ‘Exit’ option in the window.
Now the controller will work according to the program after 3 seconds.

JTAG

JTAG Fuse has been disabled in the Microcontroller AVR AT Mega 32 included in the eCee
AVR AT Mega 32 Development kit. In order to use JTAG you need to enable the fuse bit JTEN in the
Fuse bits Register. By means of AVR ICSP programmer and PonyProg software, you can simply
configure the Fuse bits.

If the JTAG is enabled, you cannot use the I/O pins PC2, PC3, PC4 and PC5 port pins as IO
lines. (That is, if the JTAG is enabled the LEDs interfaced to the port pins PC2, PC3, PC4 and PC5
will not work properly).

We bring the world to you..


www.rhydolabz.com

We bring the world to you..


www.rhydolabz.com

I/O DISTRIBUTION of eCee ATMega32 Development Board

THE I/O ASSIGN OF ATMega32


ATMega32PIN No NAME TYPE
Development Board
1 PB.0 I/O LCD(D0)/ 7SEGMENT
2 PB.1 I/O LCD(D1) / 7SEGMENT
3 PB.2 I/O LCD(D2) / 7SEGMENT
4 PB.3 I/O LCD(D3) / 7SEGMENT
5 PB.4 I/O LCD(D4) / 7SEGMENT
6 PB.5 I/O LCD(D5) / 7SEGMENT/ISP(MOSI)
7 PB.6 I/O LCD(D6) / 7SEGMENT/ISP(MISO)
8 PB.7 I/O LCD(D7) / 7SEGMENT/ISP(SCK)
9 RESET RESET SWITCH
10 VCC +5V
11 GND GROUND
12 XTAL2 CRYSTAL
13 XTAL1 CRYSTAL
14 PD.0 I/O MAX232(R20UT)
15 PD.1 I/O MAX232(T2IN)
16 PD.2 I/O IR SENSOR/INT
17 PD.3 I/O BUZZER
18 PD.4 I/O LCD(RS)/PULLUPKEY1
19 PD.5 I/O LCD(R/W)/ /PULLUPKEY2
20 PD.6 I/O LCD(E)/ /PULLUPKEY3
21 PD.7 I/O PWM //PULLUPKEY4
22 PC.0 I/O LED1/EEPROM(SCL)/RTC(SCL)
23 PC.1 I/O LED2/ EPROM(SDA)/RTC(SDA)
24 PC.2 I/O LED3/JTAG(TCK)
25 PC.3 I/O LED4/JTAG (TMS)
26 PC.4 I/O LED5/JTAG(TD0)
27 PC.5 I/O LED6/JTAG(TDI)/MATRIX
28 PC.6 I/O LED7/MATRIX
29 PC.7 I/O LED8/MATRIX
30 AVCC VCC

We bring the world to you..


www.rhydolabz.com

31 GND GND
32 AREF POTENTIOMETER(AREF)
33 PA.7 I/O MATRIXKEYPAD
MATRIXKEYPAD/ADC
34 PA.6 I/O POTENTIOMETER I/P
35 PA.5 I/O MATRIX KEYPAD/TEMP.SENSOR
36 PA.4 I/O MATRIXKEYPAD
37 PA.3 I/O 7 SEGMENT( DISP4)
38 PA.2 I/O 7 SEGMENT( DISP3)
39 PA.1 I/O 7 SEGMENT( DISP2)
40 PA.0 I/O 7 SEGMENT( DISP1)

We bring the world to you..


www.rhydolabz.com

TECHNICAL SUPPORT

If you are experiencing a problem that is not described in this manual, please contact us. Our
phone lines are open from 9:00 AM – 5.00 PM (Indian Standard Time) Monday through Saturday
excluding holidays. Email can be sent to support@rhydolabz.com

LIMITATIONS AND WARRANTEES

This product is intended for personal or lab experimental purpose and in no case should be
used where it harmfully effect human and nature. No liability will be accepted by the publisher for any
consequence of its use. Use of the product software and or hardware is with the understanding that any
outcome whatsoever is at the users own risk. All products are tested for their best performance before
shipping, still rhydoLABZ is offering One year Free service warranty (Components cost + Shipping
cost will be charged from Customer).

DISCLAIMER

Copyright © Rhydo Technologies (P) Ltd

All rights are reserved. Reproduction in whole or in part is prohibited without the prior written consent
of the copyright owner. The information presented in this document does not form part of any
quotation or contract, is believed to be accurate and reliable and may be changed without notice.

Rhydo Technologies (P) Ltd.


(An ISO 9001:2008 Certified R&D Company)
Golden Plaza, Chitoor Road,
Cochin – 682018, Kerala State, India
Phone : 0091- 484-2370444, 2371666
Cell : 0091- 99466 70444
Fax : 0091 - 484-2370579
E-mail : info@rhydolabz.com, sales@rhydolabz.com
WebSite : http://www.rhydolabz.com

We bring the world to you..

You might also like