xBoard v2.0
Easy to Use learning and development tool for Atmel AVR family of MCUs.
The development process with AVR/xBoard is outlined below.
![]() |
ISP Programmer used To Upload
a HEX file. |
![]() |
ISP Headers on xBoard v2.0 |
![]() |
ISP Programmer used To Upload
a HEX file. |
The main software you will need are:
You can get all the software from the folder named "Software" in the Support Disc. It is better to install WinAVR in root of a drive like c:\winavr or d:\winavr. Also please install WinAVR first then AVR Studio, this will let AVR Studio detect the compiler. Now you are ready to write you first microcontroller program !!! In this tutorial, you will learn the basic steps required for any microcontrollers based project. We will write a basic “hello world” project, which is a simple LED blinker.
|
Fig - AVR Studio Project Wizard |
|
Fig - Project Details |
|
Fig - Device Selection |
Fig - AVR Studio main window |
Project Area – displays all the files source and header in the current project. You can add and remove files by the context menu of different groups like “source file” , “header files” etc. Double click a file to open it in the editor.
Code Editor – Here you enter and edit the files.
/*********************************************************************
xBoard2 Sample Programs
---------------------------
Description : Simple program to blink led on PORTD7.
NOTE: PLEASE SHORT JUMPER J1 (THIS WILL CONNECT LED WITH PD7)
If you don't get the Tricks of Logical Operators
(like & and |) please see
http://extremeelectronics.co.in/avr-tutorials/programming-in-c-tips-for-embedded-development/
For Getting Started with AVR MCUs see
http://extremeelectronics.co.in/category/avr-tutorials/
Author : Avinash Gupta
Web : www.eXtremeElectronics.co.in
**********************************************************************/
#include <avr/io.h>
#include <util/delay_basic.h>
void Wait(uint8_t delay)
{
//Delay Function
uint8_t i;
for(i=0;i<delay;i++)
{
_delay_loop_2(0);
}
}
void main()
{
//Set the PORTD7 as output
DDRD=0B10000000;
while(1)
{
PORTD|=0b10000000; //Binary value 1=LED off
Wait(30);
PORTD&=0b01111111; //0=LED on.
Wait(30);
}
}
If you don't understand the program don't worry, the next tutorial will teach you how to setup and use general purpose IO ports in AVR.
Go to Project->Configuration Options to bring the Project option dialog.
|
Fig - Setting CPU frequency and compiler optimization |
Fig - Message |
“Build succeed with 1 warning. Don’t worry about the one warning it is due to the fact that ANSI standard suggest that return type of main() must be one, but for MCU platform there is no environment or operating system that will receive this returned value. So return type of main() is void.
Now you have successfully compiled you first project, what you have got after compilation is a “.hex file”. You can find it in a folder named “default” in you project folder. It has same name as you project, in this case “hello.hex”
|
Fig - Finding "hello.hex" file |
NOTE: YOU CAN ALSO GET A HELLO.HEX FILE FROM THE CD. LOOK IN THE FOLDER HEX IN THE SUPPORT DISK.
NOTE: The drivers for USB AVR Programmer must be Installed as described in its documentation
Now its time to burn this hex file to your MCU. To know how to burn the hex file to you MCU refer to you programmers manual. You can use eXtreme electronics USB AVR Programmer to burn hex files to you mcu (see shop section). Detailed procedure is given in “programmer” folder in its support CD.
Connect the USB Programmer to your PCs USB port. Make sure you connect it to that USB port in you installed it during its installation. Wait for a “ding” sound from PC. Now the programmer is installed correctly. The GREEN LED will glow to show programmer is ready.
Launch eXtreme Burner – AVR from Desktop Icon or
Start Menu. You will get a screen similar to this.
(Please Install it from CD:\USB AVR Programmer\Software\Setup.exe)
![]() |
eXtreme Burner - AVR, Main
Screen |
The software is very easy to use.
![]() |
eXtreme Burner - AVR, Burn
Progress. |
xBoard has a on board LED that can be connected to PORTD bit 7. Short JUMPER J1, this will connect the LED with PORTD7. The power indicator LED of board should glow and the LED connected to the MCU’s port should blink on and off.
![]() |
On Board LED |
Now you can relax and enjoy that light blinking with all that modern sophisticated technology behind it and you first dedicated embedded program doing all the magic.
Now go on with your imagination tweak the program, modify delay and switching logic to get interesting patterns blinking. The limit is your imagination.
Note |
Note: For More information on using AVR studio see AVR GCC Plug-in Help in the Help Menu |