[go: up one dir, main page]

0% found this document useful (0 votes)
16 views4 pages

5 Autonomous Vehicles

 hsjsnsbsbsnsmzm

Uploaded by

anamayank111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

5 Autonomous Vehicles

 hsjsnsbsbsnsmzm

Uploaded by

anamayank111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Exp No.

1 Date: D D - M M - Y Y

FAMILIARIZATION OF AVR STUDIO


Aim: To familiarize with features of AVR Studio, and practice AVR Embedded C.

Theory: AVR Studio is an integrated development environment (IDE) for developing and debugging
AVR microcontroller applications. AVR Studio provides a complete set of features including project
file management, a C/C++ editor, navigation and code completion; a debugger supporting run
control including source and instruction-level stepping; registers, memory and I/O views; and target
configuration and management. AVR Studio supports all 8 and 32-bit AVR microcontrollers, and
connects seamlessly to debuggers and development kits.

Procedure:

Opening AVR Studio

• After installation, open AVR Studio 5 from Start → All Programs → Atmel AVR Tools → AVR
Studio 5.0
• After opening, you will see a Start Page like this. Click on “New Project…“.

AVR Studio 5 Start Page

1. In new projects page ensure that C/C++ is selected in Installed Templates and
AVRGCC C Executable Project is selected. Give a suitable project name (here name
given as Exp0). Click OK.
AVR Studio New Project

• Now, you will see the Device Selection dialog box. As you can see, AVR Studio supports all the
AVR MCUs. We choose ATmega32. Click OK.

AVR Studio Device Selection

• Now, you will see the following screen. Note that the basic program structure is already
prepared for you. You simply need to initialize your variables and place your code inside the
while(1) loop.
• Type in the following code and press save button as shown.
• Now select Build->Build Exp0 to build the project and generate Hex File. If build is
successful without any error, we get a Build successful message in Output window.

• Hex file with same name as project will be generated inside Debug folder in the location
where we saved the project during Step 2. This Hex file will be used for programming the
microcontroller.
Sample code

We will write the code for blinking an LED connected in pin A.0 with a delay in between.

#define F_CPU 8000000UL /* Define CPU frequency here 8MHz */


#include <avr/io.h>
#include <util/delay.h> // for _delay_ms()

int main(void)
{
DDRA = 0x01; // initialize port A.0 as o/p
while(1)
{
// LED on
PORTA = 0b00000001; // PA0 = High = Vcc
_delay_ms(500); // wait 500 milliseconds

//LED off
PORTC= 0b00000000; // PA0 = Low = 0v
_delay_ms(500); // wait 500 milliseconds
}
}

Result:

Familiarized with AVR studio and created HEX file.

You might also like