AVR Studio for Ubuntu 11.10 About AVR The ATMEL AVR is a - TopicsExpress



          

AVR Studio for Ubuntu 11.10 About AVR The ATMEL AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to one-time programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.The AVR is a modified Harvard architecture machine where program and data are stored in separate physical memory systems that appear in different address spaces, but having the ability to read data items from program memory using special instructions. Atmel® AVR Studio® is the Integrated Development Environment (IDE) for developing and debugging embedded Atmel AVR® applications. The AVR Studio gives a seamless and easy-to-use environment to write, build, and debug your C/C++ and assembler code. The Studio is integrated with Compilers, assembler and a simulator, and interfaces seamlessly with in-system debuggers and programmers to make Windows code development easier. In this post,I will demonstrate how to create your own version of Atmel AVR Studio for Ubuntu 11.10. The post explains two (2) different ways of compiling, simulating , debugging and burning of hex unto any AVR microcontroller without the use Atmel AVR Studio. AVR Development Environment Setting Repository index update 1 sudo apt-get update *C Compiler installation 2 3 sudo apt-get install gcc # c compiler download sudo apt-get install build-essential # Packages which are considered essential for building Debian packages *skip this section, if your gcc is the current one AVR Packages Download 4 5 6 7 8 sudo apt-get install gcc-avr # A port of GCC to AVR target processor sudo apt-get install gdb-avr # AVR GNU debugger sudo apt-get install binutils-avr #low-level utilities for building & manipulating object files sudo apt-get install avr-libc # AVR Library files sudo apt-get install avrdude # command-line program for programming AVR chips. MakeFile Configuration MakeFile is a utility for automatically building executable programs and libraries from source-code. AVR MakeFile Template Download Download the make file for AVR microcontrollers from here. NB: The downloaded file should be saved into your project directory.The file should be as as “MakeFile” without extension. AVR MakeFile configurationAssumption: I’m assuming that The microcontroller is ATmega32 and programmers hardware is JTAG ICE. Then the following parameters commented in bold should be edited. 9 10 11 12 13 MCU=atmega32 /*Add the name of the processor you are using */ PROGRAMMER_MCU=m32 /* This is microcontroller id. see manual pages of avrdude. i.e gedit /etc/avrdude.conf */ PROJECTNAME=myproject /* Project name , This could be anything you wish */ AVRDUDE_PROGRAMMERID=jtagmki /*Programmer ids are listed in /etc/avrdude.conf */ AVRDUDE_PORT=/dev/ttyUSB0 /* Make sure that driver for parallel port is loaded and working and change permissions to 777 */ Sample code Testing Sample source code 14 15 16 17 18 19 20 21 22 #include int main(void) { // Set Port D pins as all outputs DDRD = 0xff; // Set all Port D pins as HIGH PORTD = 0xFF; return 1; } Save file to the same directory as the MakeFile Use your terminal and navigate to the file directory. Execution command 23 24 25 $ make /* Compile your project*/ $ make hex /* Generate hex file */ $ make install /* Burn hex file in microcontroller ( Make sure your board is switched on and programmer is connected )*/
Posted on: Mon, 17 Mar 2014 16:07:21 +0000

Trending Topics



Recently Viewed Topics




© 2015