ATMEGA16 Development Board May 2010

Similar documents
AVR Butterfly Training. Atmel Norway, AVR Applications Group

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

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

ET-BASE AVR ATmega64/128

Nuvoton Nu-Link Debug Adapter User Manual

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

Mobius 3 Circuit Board Programming Instructions

EMBEDDED C USING CODEWARRIOR Getting Started Manual

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

How to use AVR Studio for Assembler Programming

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

3. Programming the STM32F4-Discovery

Lab Experiment 1: The LPC 2148 Education Board

Microcontroller Systems. ELET 3232 Topic 8: Slot Machine Example

Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade!

AVR Prog USB v3 MK II Eco Manual

AVR1900: Getting started with ATxmega128A1 on STK bit Microcontrollers. Application Note. 1 Introduction

Using Microsoft Visual Studio API Reference

FlowKit in-circuit debug system

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

Accurate Measurement of the Mains Electricity Frequency

EvB 5.1 v5 User s Guide

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

Computer Automation Techniques. Arthur Carroll

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Programming Device Manual Booklet AVR Prog USB v2

SNMP Web Management. User s Manual For SNMP Web Card/Box

Assignment 09. Problem statement : Write a Embedded C program to switch-on/switch-off LED.

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

T-BOXN12R. First steps with T-BOXN12R. You can make it wireless. Date: Version 1.0

Display Message on Notice Board using GSM

Yun Shield Quick Start Guide VERSION: 1.0 Version Description Date 1.0 Release 2014-Jul-08 Yun Shield Quick Start Guide 1 / 14

DRV8312-C2-KIT How to Run Guide

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

Developing an Application on Core8051s IP-Based Embedded Processor System Using Firmware Catalog Drivers. User s Guide

MAX6683 Evaluation System/Evaluation Kit

EVAL-UFDC-1/UFDC-1M-16

Board also Supports MicroBridge

AC-PG-USBASP USBASP AVR Programmer

Work with Arduino Hardware

QT1 Xplained Pro. Preface. Atmel QTouch USER GUIDE

WinLIN Setup and Operation:

AVR-ISP-MK2 programmer USER S MANUAL Revision I, October 2013 Designed by OLIMEX Ltd, 2012

Testing Robots Using the VEXnet Upgrade

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

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

Keil C51 Cross Compiler

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

USB - FPGA MODULE (PRELIMINARY)

Lab 3 Microcontroller programming Interfacing to Sensors and Actuators with irobot

An Introduction to MPLAB Integrated Development Environment

INTRODUCTION TO SERIAL ARM

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

Tutorial: Configuring GOOSE in MiCOM S1 Studio 1. Requirements

EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University. Multitasking ARM-Applications with uvision and RTX

[F/T] [5] [KHz] [AMP] [3] [V] 4 ) To set DC offset to -2.5V press the following keys [OFS] [+/-] [2] [.] [5] [V]

UPS PIco. to be used with. Raspberry Pi B+, A+, B, and A. HAT Compliant. Raspberry Pi is a trademark of the Raspberry Pi Foundation

Radiocrafts Embedded Wireless Solutions

Guide to Installing BBL Crystal MIND on Windows 7

Installing a Westell USB Network Adapter

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

KTA-223 Arduino Compatible Relay Controller

GSM Interfacing Board

Lab 1 Course Guideline and Review

Freescale Semiconductor, I

Controlling a Dot Matrix LED Display with a Microcontroller

BASLER ACE QUICK INSTALLATION GUIDE

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

DisplayPort 2-Port KVM Switch Installation Guide

Hardware and Software Requirements

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

CodeWarrior Development Studio for Freescale S12(X) Microcontrollers Quick Start

The $25 Son of a cheap timer This is not suitable for a beginner. You must have soldering skills in order to build this kit.

USB PC Adapter V4 Configuration

GPS/GLONASS SiRFstarV Evaluation Kit EVA5100-A

MS830 / MS833 Barcode Reader v1.0 9-December-2014

STK User Guide

INDEX. Trademarks All name and product s trademarks mentioned below are the property of their respective companies.

AVR033: Getting Started with the CodeVisionAVR C Compiler. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Project Manager Editor & Debugger

Real Time Clock USB Evaluation Board V3.0

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

Evo Laser Firmware Developer s Manual

Installation Instructions for 9555 USB Driver

ScanWin Installation and Windows 7-64 bit operating system

PRODUCTIVITY THROUGH INNOVATION 600 CONTROL DIRECT DRIVE TECHNICAL/OPERATION MANUAL

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Experiment 2 Introduction to TI C2000 Microcontroller, Code Composer Studio (CCS) and Matlab Graphic User Interface (GUI)

User Guide Reflow Toaster Oven Controller

Using the VEX Cortex with ROBOTC

Application Note: Connecting to a 2500 Series Processor using PLC Workshop

Current Cost Data Cable User Guide. Installing and configuring the data cable

EasyPIC4 User s Manual

isppac-powr1220at8 I 2 C Hardware Verification Utility User s Guide

USB to Serial Quick Installation Guide

Waspmote. Quickstart Guide

Quick Installation. A Series of Intelligent Bar Code Reader with NeuroFuzzy Decoding. Quick Installation

Transcription:

ATMEGA16 Development Board May 2010 NEX Robotics Pvt. Ltd. 1

ATMEGA16 Development Board ATMEGA16 Development Board. Introduction ATMEGA16 Development Board is made from double sided PTH PCB board to provide extra strength to the connector joints for increased reliability. Board can work on 7 to 15V AC or DC supply. It has built-in reverse polarity protection. 7805 voltage regulator has heat sink for heat dissipation so that it can supply 1Amp current continuously without getting over heated. It has switches for boot loading, reset and power. It also has RS232 interface with DB9 female connector based on MAX232. All the ports are connected to standard 10 pin FRC connectors. Open pads for connecting microcontroller s pins to external devices are also provided. Specifications Microcontroller: ATMEGA16 with 14.7456MHz crystal (Also supports ATMEGA32) Double side high quality PTH PCB for added strength. Power: 7 to 15V, AC or DC, Heat sink on 7805 for better current rating. Reverse polarity protected. Switches: Boot, Reset, Power. RS232 serial interface. 10 pin FRC connectors and soldering pads on all ports. Compatible with General purpose prototyping board for development board for stackable design. Application examples in AVR studio provided in the documentation CD. Package contains ATMEGA16 Development Board with ATMEGA16 microcontroller Documentation CD containing tutorial for ATMEGA16 microcontroller programming in AVR studio and application examples. NEX Robotics Pvt. Ltd. 2

Documentation CD contain following Application examples I/O Port operation Interrupt control Timer to generate accurate delay Timer as external Counter PWM (Pulse Width Modulation) for power control ADC (Analog to Digital Conversation) UART (Serial Communication) LCD(Print string of data on LCD) ATMEGA 16 Development Board Warning: Do not give Power supply more than 15 V AC/DC. Note: ATMEGA 16 Development Board schematic is in the documentation CD PORT FRC connector pin connections Pin No. Pin Function 1 Pin 0 of PORT X 2 Pin 1 of PORT X 3 Pin 2 of PORT X 4 Pin 3 of PORT X 5 Pin 4 of PORT X 6 Pin 5 of PORT X 7 Pin 6 of PORT X 8 Pin 7 of PORT X 9 5V 1A output of 7805 voltage regulator 10 Ground NEX Robotics Pvt. Ltd. 3

Power Port pin connections Power port is used to give power to the accessories boards compatible to the microcontroller development board Pin No. Pin Function 1 5V 1A output of 7805 voltage regulator 2 5V 1A output of 7805 voltage regulator 3 Ground 4 Ground 5 Vin DC (Input supply 1.2V DC drop due to bridge rectifier) 6 Vin DC (Input supply 1.2V DC drop due to bridge rectifier) 7 NC 8 NC 9 NC 10 NC NEX Robotics Pvt. Ltd. 4

Using AVR studio for ATMEGA16 Development Board Programming There are lots of IDEs (Integrated Development Environment) available for the AVR microcontrollers. There are free IDEs which are based on AVR GCC like AVR Studio from ATMEL and WIN AVR and proprietary IDEs like ICC AVR, Code vision AVR, IAR and KEIL etc. IDEs like ICC AVR and code vision AVR are very simple to use because of their GUI based code generator which gives you generated code. Almost all the proprietary IDEs works as full version for first 45 days and then there code size is restricted to some size. For this development board we are using AVR studio from the ATMEL. It uses WIN AVR open source C compiler at the back end. It has many attractive features like built-in In-Circuit Emulator and AVR instruction set simulator. After writing and compiling the program it gives.hex file. This.hex file needs to be loaded on the robot using In System Programmer (ISP). Installing AVR Studio and WIN AVR Before Installing AVR studio, we need to install WIN AVR as AVR studio uses WIN AVR at the backend. Both softwares should be installed in the same drive. AVR Studio and WIN AVR are located in the software folder in the documentation CD. Installing WIN AVR Go to Software folder in the documentation CD, copy folder WIN AVR 2009-03-13 on the PC and click on WinAVRxxxx.exe to start the installation process. WIN AVR installation package will open. Choose language as English. NEX Robotics Pvt. Ltd. 5

Click next in the WIN AVR setup wizard. Press I Agree after going through license agreement. NEX Robotics Pvt. Ltd. 6

Make sure that you select drive on which operating system is installed. Select all the components and press Install. NEX Robotics Pvt. Ltd. 7

Click Finish to complete WIN AVR installation NEX Robotics Pvt. Ltd. 8

Installing AVR Studio Go to Software folder from the documentation CD, copy folder AVR Studio 4.17 on the PC and click on AvrStudio417Setup.exe to start the installation process. Click on Run NEX Robotics Pvt. Ltd. 9

Click Next to start installation of AVR Studio 4 After clicking Next go through the license agreement. If it is acceptable then click Next NEX Robotics Pvt. Ltd. 10

Now choose the destination drive. Select the same drive in which your operating system and WINAVR is installed. Select for the Install / upgrade Jungo USB Driver to support In System Programming (ISP) by AVRISP mkii NEX Robotics Pvt. Ltd. 11

Important: If Install / upgrade Jungo USB Driver is not selected then AVRISP mkii programmer will not work with the AVR Studio. Click Next to start the installation process. Click Finish to complete the installation process. NEX Robotics Pvt. Ltd. 12

Setting up Project in AVR Studio AVR studio is an Integrated Development Environment (IDE) for writing and debugging AVR applications. As a code writing environment, it supports included AVR Assembler and any external AVR GCC compiler in a complete IDE environment. AVR Studio gives two main advantages: 1. Edit and debug in the same application windows. Faster error tracking. 2. Breakpoints are saved and restored between sessions, even if codes are edited. Middle window shows current code under development. Window on the left side shows view of source files, header files, External dependencies, and other files. Right side window shows all the ports and other peripheral s status. Bottom window is known as Build window. It shows results of the compilation, errors, HEX file size and other warning messages etc. 1. Open AVR Studio. If any project is running it can be closed by clicking on Project in the menu and select Close Project. 2. To create new project click on Project in the menu and select New Project. NEX Robotics Pvt. Ltd. 13

3. Select Project Type as AVR GCC. Type project name in the Project name window. In this case it is buzzer_test. Also check on Create folder check box. This will create all the files inside the new folder. In the Location window select the place where would like to store your project folder and then click Next. 4. Select debug platform and Device. In this case we have selected AVR simulator and ATMEGA16 microcontroller and click finish. NEX Robotics Pvt. Ltd. 14

5. Now we are almost ready to write our first code. Before we start coding we will check other setting to make sure that they are set properly. 6. Open Project menu and click on the Configuration option. NEX Robotics Pvt. Ltd. 15

7. In the Project Option General tab will open. Select device as ATMEGA16 and frequency (Crystal Frequency) as 16 MHz i.e. 16000000. Set the optimization level be at -O0. Selecting proper optimization options Optimization option defines the optimization level for all files. Higher ptimization levels will produce code that is harder to debug. Stack variables may change location, or be optimized away, and source level debugging may "skip" statements because they too have been optimized away. The levels of optimization are: -00 No optimization. This is the same as not specifying any optimization. -01 Optimize. Reduces code size and execution time without performing any optimizations that take a great deal of compilation time. -02 Optimize even more. avr-gcc performs almost all optimizations that don't involve a space-time tradeoff. -03 Optimize yet more. This level performs all optimizations at -O2 along with finline -functions and frename registers. -Os Optimize for size. Enables all -O2 optimizations that don't increase code size. It also performs further optimizations designed to reduce code size. For more information on optimization, see the 'man' pages for avr-gcc. Important: During the coding choose appropriate optimization option. If you feel that code is not working properly as it should be then turn off all optimization by selecting optimization option as -00. Once you know that your code is properly working then you can incrementally increase optimization level. We suggest that always use optimization level as -00 at the beginner level. NEX Robotics Pvt. Ltd. 16

8. Make sure that in the External Tools, proper path for avr-gcc.exe and make.exe are given and press ok. Now we are ready to write our first code. NEX Robotics Pvt. Ltd. 17

Writing your first code in AVR Studio This program will make Board buzzer beep. //Buzzer is connected at the third pin of the PORTC //To turn it on make PORTC 3rd (PC3 )pin logic 1 #include <avr/io.h> #include <avr/interrupt.h> #include <util/delay.h> //Function to initialize Buzzer void buzzer_pin_config (void) { DDRC = DDRC 0x08; //Setting PORTC 3 as output PORTC = PORTC & 0xF7; //Setting PORTC 3 logic low to turnoff buzzer } void port_init (void) { buzzer_pin_config(); } void buzzer_on (void) { unsigned char port_restore = 0; port_restore = PINC; port_restore = port_restore 0x08; PORTC = port_restore; } void buzzer_off (void) { unsigned char port_restore = 0; port_restore = PINC; port_restore = port_restore & 0xF7; PORTC = port_restore; } void init_devices (void) { cli(); //Clears the global interrupts port_init(); sei(); //Enables the global interrupts } int main(void) //Main Function { init_devices(); while(1) { buzzer_on(); _delay_ms(1000); //delay buzzer_off(); _delay_ms(1000); //delay } } NEX Robotics Pvt. Ltd. 18

We are now going to compile this code to generate the hex file which we will load on the Microcontroller Board. Select Build menu and click on Rebuild All. It will compile the buzzer_test.c code and will generate buzzer_test.hex file for the microcontroller Board. You can verify successful compilation in the bottom most Build window of the AVR Studio. You can also verify that buzzer_test.hex file is generated in the default folder inside the folder you have selected. NEX Robotics Pvt. Ltd. 19

Debugging the code in AVR studio After successful compilation of the code we can debug the code by AVR Debugger provided by AVRStudio. Here is the illustration of debugging of code given earlier. Click on Debug tab in the menu and click on Start Debugging. Now debugging mode is started and an arrow is visible at the first line of our main function from where the debugging will start. NEX Robotics Pvt. Ltd. 20

Press F11 key or Step into button from the toolbar to start debugging statement by statement. Processor details are visible at left window and the I/O port status is displayed at the rightmost window. By this way we can continuously monitor the bit changes in any of the registers of microcontroller and debug the code before actually burning it to the microcontroller. PORTC bits changes as per our commands and these changes can be seen in right window. After debugging is done select Stop Debugging from Debug tab. NEX Robotics Pvt. Ltd. 21

Notice The contents of this manual are subject to change without notice. All efforts have been made to ensure the accuracy of contents in this manual. However, should any errors be detected, NEX Robotics welcomes your corrections. You can send us your queries / suggestions at info@nex-robotics.com Content of this manual is released under the Creative Commence cc by-nc-sa license. For legal information refer to: http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode Product s electronics is static sensitive. Use the product in static free environment. Read the user manuals completely before start using this product Recycling: Almost all the part of this product are recyclable. Please send this product to the recycling plant after its operational life. By recycling we can contribute to cleaner and healthier environment for the future generations. NEX Robotics Pvt. Ltd. 22