Setup Atmel Studio 7 for Arduino IDE

After i installed Arduino IDE as developement tools and written few programs. Arduino IDE is very user friendly, targeted toward non-developers. But that will not suite for our future research. ATMEL Studio 7 will can fill the gap for professional development tool. There are many pros and cons when using AVR Studio over Arduino IDE.  ATMEL Studio 7 have great feature called Atmel Data Visualizer (this is our reaeson, why we should compile Arduino in this IDE😀 )

Atmel Data Visualizer

This feature will track your applications run-time and power behavior using the powerful Atmel Data Visualizer plug-in. It provides an oscilloscope view of signals such as GPIO, SPI, UART, etc.and also provides live power measurements when used together with a supported probe or board. Having full control of your codes run-time behavior has never been easier.

In this tutoriallabs, we will show you how to set up Atmel Studio 7  (a.k.a AVR Studio) for Arduino software development IDE.

Step 1: Installing AVR Studio.

  1. Download the ATMEL studio 7 ( it can found at http://www.atmel.com/tools/atmelstudio.aspx#download
  2. Installing AVR studio is similar to any other windows application, follow the installer wizard and answer the question
  3. This is welcome picture IDE:
    atmel 7

Step 2: Config AVRDude in Atmel Studio 7

  1. Download and install Arduino IDE, it IDE also installing AVRDude
  2. Integrated AVRDude and Atmel Studio 7, with Select Tools > External Tools and fill with :
    1. Title : Arduino COM8
    2. Command : C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe
    3. Arguments : -C”C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf” -patmega328p -c arduino -P COM8 -b 115200 -D -U flash:w:”$(ProjectDir)Debug\$(TargetName).hex”:i

    ***note: i’m using com 8 as serial interfacing***

external tools

Step 3: Create new project in AVR Studio.

  1. From the menu select File > New > Project
  2. In the upcoming dialog window select C/C++ > GCC C Executable Project, then filling the details like Name, Location, Solution Name and click OK
  3. Now select the micro controller from the list. Here we selected ATmega328p(Select the processor based on the board you are using – we are using Arduino Uno R3)arduino

Step 3: Configure the Project

  1. Click from menu Project > Properties
  2. Select Toolchain > AVR/GNU C Compiler > Symbols
  3. In the Defined Symbols add F_CPU=16000000UL. This says what is your CPU clock speed,

Note: Arduino Uno runs at 16MHz, so 16000000UL. 1MHz = 1000000UL, please check your Arduino if using another type of board

16mhz

Step 4: Write a test program

Here is the program to blink the LED (in Pin 13).


/*
 * test_blink.c
 *
 * Created: 31/07/2016 19.28.17
 * Author : SDP
 */

#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
 DDRB = (1 << DDB5); 
 while(1)
 {
 // LED on
 PORTB = (1 << DDB5);
 _delay_ms(100); //mengatur delay
 // LED off
 PORTB = 0; 
 _delay_ms(100);
 }
}

build and compile code with  Build, Build Solution (F7) and send compiling code to device with tools, Arduino COm8

ex

see your arduino board, led will blinking every ms😀

 

refrence  :

http://www.atmel.com/Microsite/atmel-studio/

https://www.arduino.cc/en/Hacking/Atmega168Hardware

https://asensar.com/blog/2013/how-to-setup-atmel-studio-for-arduino-development/

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s