Using Arduino Boards in Atmel Studio

Similar documents
Microcontroller Systems. ELET 3232 Topic 8: Slot Machine Example

ET-BASE AVR ATmega64/128

GertDuino Board. User Manual. Exclusively From. By: G.J. van Loo, Version 1.4 Dated: 6 th Nov P age

Tiny-Dice Electronic dice using an ATtiny2313

INTRODUCTION TO SERIAL ARM

AVR Prog USB v3 MK II Eco Manual

Programming Device Manual Booklet AVR Prog USB v2

AC-PG-USBASP USBASP AVR Programmer

How to use AVR Studio for Assembler Programming

Steps for running C-program

Programming the On-Chip Flash on a phycore-xc161 phycore-xc167

DSO138 oscilloscope program upgrade method

AVR Butterfly Training. Atmel Norway, AVR Applications Group

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

KTA-223 Arduino Compatible Relay Controller

2013 G Miller. 3 Axis Brushless Gimbal Controller Manual

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

Board also Supports MicroBridge

An Introduction to MPLAB Integrated Development Environment

GSM Click - Cross-Platform Development Quick Start Guide

Pololu USB AVR Programmer User's Guide

Connecting your Omega/BetaPAT PLUS to a PC via a USB

USER GUIDE. ZigBit USB Stick User Guide. Introduction

EPIC 950 THERMAL TICKET PRINTER

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

Centurion C4 Transfer Guide using C4 File Transfer Utility

Arduino Due Back. Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum. Overview

Arduino Lesson 1. Blink

Why using ATmega16? University of Wollongong Australia. 7.1 Overview of ATmega16. Overview of ATmega16


Adafruit SHT31-D Temperature & Humidity Sensor Breakout

PN532 NFC RFID Module User Guide

Using the Communication Ports on the DG-700 and DG-500 Digital Pressure Gauges

User Manual. CC2400DBK Demonstration Board Kit

AVR030: Getting Started with IAR Embedded Workbench for Atmel AVR. 8-bit Microcontrollers. Application Note. Features.

Workshop Intel Galileo Board

WIZ-Embedded WebServer User s Manual (Ver. 1.0)

STK User Guide

Adafruit BME280 Humidity + Barometric Pressure + Temperature Sensor Breakout

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

Tiny Arduino Music Visualizer

MT-350 SMS. Operation Manual. PORTech Communications Inc.

Lab Experiment 1: The LPC 2148 Education Board

ezsystem elab16m Project 1F: Alarm System (Full Project description)

Supplemental USB Driver Installation Guide

DS1307 Real Time Clock Breakout Board Kit

Mobius 3 Circuit Board Programming Instructions

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Warnings: This manual is intended to guide a technicians or customers who would like to repair DBL's

Installing the Gerber P2C Plotter USB Driver

USER GUIDE EDBG. Description

ABB solar inverters. Installation and setup instruction Aurora Manager TL software and ABB PVI-USB-RS232_485 adapter

1-10 The USB PIC K150 microcontroller programmer Hardware version V2.0 File version V2.0 Product Image

SEC 4100 SYSTEM MONITOR Programmable Serial Interface Card Series 2

Start A New Project with Keil Microcontroller Development Kit Version 5 and Freescale FRDM-KL25Z

PM1122 INT DIGITAL INTERFACE REMOTE

Vicon Flash Upgrade Software

PolyBot Board. User's Guide V1.11 9/20/08

Instructions for Installing and Using the FOCUS DL-15 Data Transfer Software

Android Controlled Based Interface

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

Getting Started with Embedded System Development using MicroBlaze processor & Spartan-3A FPGAs. MicroBlaze

32-bit AVR UC3 Microcontrollers. 32-bit AtmelAVR Application Note. AVR32769: How to Compile the standalone AVR32 Software Framework in AVR32 Studio V2

EvB 5.1 v5 User s Guide

9XR Pro: Using the Eepskye Program

Windows: AVR microcontroller programming in C

MonitorKey USB Driver Installation Instructions

SainSmart UNO R3 Starter Kit

Running the R4 Software on a USB Port

ic-mq EVAL MQ1D EVALUATION BOARD DESCRIPTION

EE318 Electronic Design Lab Project Report, EE Dept, IITB, April Wireless Microcontroller Programmer

Creating a Project with PSoC Designer

Communication with BushingGard using computer USB port

Centurion PLUS CPC4 Download Guide

Application Note: AN00141 xcore-xa - Application Development

Vicon Flash Upgrade Software

Six-servo Robot Arm. DAGU Hi-Tech Electronic Co., LTD Six-servo Robot Arm

Work with Arduino Hardware

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board

Flight Controller. Mini Fun Fly

Application Note: Using the Motor Driver on the 3pi Robot and Orangutan Robot Controllers

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

SIM808 V2.2.5 user manual V1.2. Electrodragon.com

GW-7552 PRIFIBUS/MODBUS GATEWAY

AVR Timer/Counter. Prof Prabhat Ranjan DA-IICT, Gandhinagar

LCD I 2 C/Serial RX Backpack. Data Sheet. LCD to I2C/Serial RX Backpack I2C or Serial RX communication with Standard 16 Pin LCD modules

USB PC Adapter V4 Configuration

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

Using the HCS12 Serial Monitor on Wytec Dragon-12 boards. Using Motorola s HCS12 Serial Monitor on Wytec s Dragon-12 boards

Human Computer Interaction Final Project Tutorial. Hardware Inventory Management System (HIMS) By M. Michael Nourai

Windows 95 Revision B Installation Instructions

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

SharePoint List Filter Favorites Installation Instruction

DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB

Arduino Lab 1 - The Voltage Divider

Electrical Engineering Department College of Engineering California State University, Long Beach Long Beach, California, 90840

Blastmate III and Minimate Plus USB to PC Cable (Part No. 716A3401)

E-LINK FOR ARM. E-Link User maunal / 46

ISP Engineering Kit Model 300

Transcription:

Using Arduino Boards in Atmel Studio Sepehr Naimi BIHE University 4/14/2015

Contents Introduction... 3 Installing Atmel Studio and Making the First Project... 3 Downloading Avrdude... 3 Checking COM Port... 4 Opening the Atmel Studio and using avrdude... 5 Making a Project... 7 Programming the Arduino Board... 9 The IC pins...10 References...10

Introduction There are varieties of hardware tools to program Atmel microcontrollers. But if the chips have bootloaders, they can be programmed using serial ports without needing to use any hardware tools. Bootloader is small software which gets the program through the serial port and programs the IC chip. The microcontrollers of Arduino boards have boot loaders. As a result you can connect them to the PC and use them as an AVR trainer board. The document teaches you to use Arduino Trainer boards in Atmel Studio. You can also burn the boot loader on a new chip and make your own trainer board. But to program the boot loader onto the new chip you need a programmer. Installing Atmel Studio and Making the First Project To install Atmel Studio and make the first project, read one of the following documents: Assembly Programming in Atmel Studio 6.2 (Step by step tutorial) C Programming in Atmel Studio 6.2 (Step by step tutorial) Downloading Avrdude 1. To program Arduino boards you need Avrdude. Download Avrdude from the following website: http://mirror.rackdc.com/savannah//avrdude/avrdude-5.11-patch7610-win32.zip 2. Unzip the downloaded file, rename the directory to avrdude, and copy it into your C drive. Note If you already have the Arduino IDE on your PC, the avrdude.exe file is located in C:\Program Files (x86)\arduino\hardware\tools\avr\bin\avrdude.exe and avrdude.conf is in C:\Program Files (x86)\arduino\hardware\tools\avr\etc\avrdude.conf

Checking COM Port 1. Right click on the Computer icon and choose Manage. 2. Click on Device Manager and then Ports (COM & LPT). Check the COM port.

Opening the Atmel Studio and using avrdude 3. Open the Atmel Studio IDE. 4. Go to the Tools menu and choose External Tools. 5. In the External Tools dialog: a. Press the Add button b. Name it Arduino Programmer. c. Type the following address next to the Command: C:\avrdude\avrdude.exe d. Avrdude needs the following arguments: avrdude.conf file, the COM port, the serial baud rate, the hex file to be programmed and the microcontroller part number. The following table gives the arguments for different Arduino board. They should be typed in the Arguments textbox: Board IC Chip Arguments Arduino Uno Atmega328p -C "C:\avrdude\avrdude.conf" -p atmega328p -c arduino -P COM9 -b 115200 -U flash:w:"$(projectdir)debug\$(itemfilename).hex":i Arduino Pro Atmega328p -C " C:\avrdude\avrdude.conf" -p atmega328p -c arduino -P COM9 -b 57600 -U flash:w:"$(projectdir)debug\$(itemfilename).hex":i Mini Arduino Mega2560 Note: Change the COM port and the location of avrdude.conf, according to your computer. Atmega2560 -C " C:\avrdude\avrdude.conf" -p atmega2560 -c wiring -P COM9 -b 115200 -U flash:w:"$(projectdir)debug\$(itemfilename).hex":i e. Tick "Use Output window". f. Press OK.

6. Go to the Tools menu again. Arduino Programmer should be added to the Tools menu.

Making a Project 7. Go to the File menu. Click on New and then Project. 8. Choose GCC C Executable Project and name the project as toggleproject. Then press OK.

9. Choose ATmega328 from the list and press OK. 10. Type the following program. /* * toggleprogram.c * * This program toggles ports B, C, and D. * * Created: 4/3/2015 4:43:51 PM * Author: Naimi */ #include <avr/io.h> #define F_CPU 16000000UL #include "util/delay.h" int main(void) { DDRB = 0xFF; DDRC = 0xFF; while(1) //loop forever { PORTB ^= 0xFF; //toggle port B PORTC ^= 0xFF; //toggle port C } } _delay_ms(1000); //wait 1 second

Programming the Arduino Board 11. Connect your Arduino board to the PC. 12. Go to the Tools menu, and click on Arduino Programmer. The following texts appear in the Output window and the L LED starts blinking on the board.

The IC pins The following picture shows the Arduino UNO board together with the Atmega328 pins. Label A0 A1 A2 A3 A4 A5 Port PC0(ADC0) PC1(ADC1) PC2(ADC2) PC3(ADC3) PC4(ADC4) PC5(ADC5) Label SCL SDA AREF Port PC5(ADC5/SCL) PC4(ADC4/SDA) AREF GND GND 13 PB5(SCK) 12 PB4(MISO) 11 PB3(MOSI) 10 PB2(OC1B) 9 PB1(OC1A) 8 PB0 7 PD7 6 PD6 5 PD5 4 PD4 3 PD3(INT1) 2 PD2(INT0) 1 PD1(TXD) 0 PD0(RXD) References http://www.atmel.com/ http://www.nongnu.org/avrdude/ http://www.jayconsystems.com/tutorial/atmerpt1/