Line 1: Line 1:
{{Box|type=l_green_light|text=
+
 
 
[[Category:AVR Tutorials]]
 
[[Category:AVR Tutorials]]
 
[[File:AVR_tools_SW_HW.JPG|x250px|Hardware and SW Tools]]
 
[[File:AVR_tools_SW_HW.JPG|x250px|Hardware and SW Tools]]
 
=Introduction:=
 
=Introduction:=
 +
{{Box|type=l_green_light|text=
 
In this tutorial we will look at the basic setup required to get started with AVR series of microcontrollers. There are two aspects to it, the software and the hardware. Fortunately, we for AVR there are free software tools available and even some of it is open-source! In this entire tutorial series we will be demonstrating the hardware on aspects on Ultra AVR Development board and also on breadboard and Starter AVR development board wherever possible. Having said that we will release all the schematics and code for you to hack and build on your own.
 
In this tutorial we will look at the basic setup required to get started with AVR series of microcontrollers. There are two aspects to it, the software and the hardware. Fortunately, we for AVR there are free software tools available and even some of it is open-source! In this entire tutorial series we will be demonstrating the hardware on aspects on Ultra AVR Development board and also on breadboard and Starter AVR development board wherever possible. Having said that we will release all the schematics and code for you to hack and build on your own.
                 
+
}}             
 
=Software=
 
=Software=
 +
{{Box|type=l_green_light|text=
 
Let’s talk about software first:
 
Let’s talk about software first:
 
# [http://www.atmel.com/tools/atmelstudio.aspx Atmel Studio 6.2: ] This is complete software suite from Atmel; it is an integrated development Environment that allows you to write C/C++ programs, complies with a free AVRGCC compiler and produces hex files.  You can download it [http://www.atmel.com/tools/atmelstudio.aspx here]. Choose the download option according to your existing setup.
 
# [http://www.atmel.com/tools/atmelstudio.aspx Atmel Studio 6.2: ] This is complete software suite from Atmel; it is an integrated development Environment that allows you to write C/C++ programs, complies with a free AVRGCC compiler and produces hex files.  You can download it [http://www.atmel.com/tools/atmelstudio.aspx here]. Choose the download option according to your existing setup.
Line 11: Line 13:
 
## [http://extremeelectronics.co.in/avr-tutorials/gui-software-for-usbasp-based-usb-avr-programmers/ Extreme Burner]
 
## [http://extremeelectronics.co.in/avr-tutorials/gui-software-for-usbasp-based-usb-avr-programmers/ Extreme Burner]
 
## [http://khazama.com/project/programmer/ Khazama]  
 
## [http://khazama.com/project/programmer/ Khazama]  
 +
}}
 
==Setting up Atmel Studio 6:==
 
==Setting up Atmel Studio 6:==
  
Line 32: Line 35:
 
File:Image018.png|Step 16
 
File:Image018.png|Step 16
 
</gallery>
 
</gallery>
 +
{{Box|type=l_green_light|text=
 
* '''Step 1:''''' Open the Avr Atmel Studio-6 and select the new project from File Menu as shown below.''
 
* '''Step 1:''''' Open the Avr Atmel Studio-6 and select the new project from File Menu as shown below.''
 
* '''Step 2:'' '''Browse to your project folder and provide the project name and click on Ok.''''' '''
 
* '''Step 2:'' '''Browse to your project folder and provide the project name and click on Ok.''''' '''
Line 54: Line 58:
 
* '''Step 16:''' Finally recompile after all configurations. Hex file will be generated with the project name in the selected   
 
* '''Step 16:''' Finally recompile after all configurations. Hex file will be generated with the project name in the selected   
 
** '''Project-&gt;Debug folder'''.
 
** '''Project-&gt;Debug folder'''.
 +
*Once the hex file is generated check the steps under [[Using XploreFlash]] to transfer it to target MCU.
 +
}}
 
=Hardware Tools=
 
=Hardware Tools=
 +
{{Box|type=l_green_light|text=
 
We will be using the following hardware tools in the entire tutorial series.
 
We will be using the following hardware tools in the entire tutorial series.
 
*[[AVR Development Kit]]: This Kit includes MCU as well as programmer with a lot of peripherals.
 
*[[AVR Development Kit]]: This Kit includes MCU as well as programmer with a lot of peripherals.

Revision as of 15:26, 19 August 2014

Hardware and SW Tools

Introduction:

In this tutorial we will look at the basic setup required to get started with AVR series of microcontrollers. There are two aspects to it, the software and the hardware. Fortunately, we for AVR there are free software tools available and even some of it is open-source! In this entire tutorial series we will be demonstrating the hardware on aspects on Ultra AVR Development board and also on breadboard and Starter AVR development board wherever possible. Having said that we will release all the schematics and code for you to hack and build on your own.

Software

Let’s talk about software first:

  1. Atmel Studio 6.2: This is complete software suite from Atmel; it is an integrated development Environment that allows you to write C/C++ programs, complies with a free AVRGCC compiler and produces hex files. You can download it here. Choose the download option according to your existing setup.
  2. The Programming Software: The programming SW is required to transfer hex file to the target MCU. There are various options available depending on the programmer you’re using. In this tutorial series we will be using Xplore Flash. There are other software that you could also try
    1. Extreme Burner
    2. Khazama

Setting up Atmel Studio 6:

* Step 1: Open the Avr Atmel Studio-6 and select the new project from File Menu as shown below.

  • Step 2: Browse to your project folder and provide the project name and click on Ok.
  • Step 3: Once the project is saved a new dialog box “Device Selection” opens, Select Atmega32 and click OK.
  • Step 4: Once the project is successfully created the below window opens with the initil .c file .
    • Note: The initial file name will be same as project name.
  • Step 5: Write your program using the library functions and save it.
  • Note: Include the respective header files before calling any library functions.
  • Step 6: Add the library files (.c,.h) to the project as shown below.
  • Note: Copy the library files into the project folder before including them into the project
  • Step 7: Add the Source (.c) and header( .h) files by browsing to the project folder.
  • Step 8: The included library files can be seen in Solution Explorer on the right side.
  • Step 9: Compile the project by clicking on Build Solution from Build menu (or press F7). Project complies if there are no errors. If there are any errors fix them and re-compile.
  • Step 10: Configure the Controller Freq by selecting the project properties from Project menu.
    • Note: As the Inbuilt delay routines as used the freq needs to be specified to generate accurate delays
  • Step 11: Select the Symbols from Tool Chain menu and Click on Add Item in Defined Symbols(-D) box.
  • Step 12: Provide the Controller (Target Board) frequency as F_CPU=xxx Hz .In this case it is 11.0592Mhz.
  • Step 13: Configuring the optimization levels: Select the Optimization from Tool Chain menu. Select the required optimization level from drop down. Refer WinAvr/GCC documents for more optimization details.
  • Step 14: Selecting the target tool chain: Select the Advanced option on the left side, now click the link shown in blue color Tools->Options->Tool chain ->Flavor Configuration.
  • Step 15: From the drop down select WinAVR and set it as Default tool chain by clicking on “Set As Default”.
    • Note: Above two Steps ( 14 & 15) needs to be performed for the first time, ie till the WinAVR is configured as default Tool chain .
  • Step 16: Finally recompile after all configurations. Hex file will be generated with the project name in the selected
    • Project->Debug folder.
  • Once the hex file is generated check the steps under Using XploreFlash to transfer it to target MCU.

Hardware Tools

We will be using the following hardware tools in the entire tutorial series.