USER MANUAL FOR ATMEGA 16/32 ROBOTICS MINI DEVELOPMENT BOARD V2.0 USING AVR STUDIO

Similar documents
INTRODUCTION. We are living in an age of Information Technology. Electronics is at the very foundation of the

ET-BASE AVR ATmega64/128

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Cell Phone Operated Land Rover

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

A 5 Degree Feedback Control Robotic Arm (Haptic Arm)

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

PROJECT PRESENTATION ON CELLPHONE OPERATED ROBOTIC ASSISTANT

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

Lab Experiment 1: The LPC 2148 Education Board

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

Android Controlled Based Interface

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

AVR Butterfly Training. Atmel Norway, AVR Applications Group

Controlling a Dot Matrix LED Display with a Microcontroller

An Introduction to MPLAB Integrated Development Environment

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

STK User Guide

CHAPTER 11: Flip Flops

revolution Contents: Introduction Power 28-pin Project Board with input/output cables

APPLICATION NOTE Atmel AT02509: In House Unit with Bluetooth Low Energy Module Hardware User Guide 8-bit Atmel Microcontroller Features Description

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

Using Arduino Microcontrollers to Sense DC Motor Speed and Position

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

The Programming Interface

Mobile Operated Landrover Using Dtmf Decoder

If an occupancy of room is zero, i.e. room is empty then light source will be switched off automatically

UPiS - Uninterruptible Power intelligent Supply

EvB 5.1 v5 User s Guide

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

INTRODUCTION TO SERIAL ARM

Embedded Systems on ARM Cortex-M3 (4weeks/45hrs)

GPS & GSM BASED REAL-TIME VEHICLE TRACKING SYSTEM.

POCKET SCOPE 2. The idea 2. Design criteria 3

Designing VM2 Application Boards

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

Nagpur, Maharashtra, India

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

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

8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.

Lab 1 Course Guideline and Review

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

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

AT15007: Differences between ATmega328/P and ATmega328PB. Introduction. Features. Atmel AVR 8-bit Microcontrollers APPLICATION NOTE

[Deotale, 4(7): July, 2015] ISSN: (I2OR), Publication Impact Factor: 3.785

How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player

Accurate Measurement of the Mains Electricity Frequency

Ocean Controls RC Servo Motor Controller

Glolab Talking Phone Dial Monitor

Tutorial. replace them with cell-phone operated module. The advantages of a cell-phone operated bot are:-

Microprocessor & Assembly Language

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

Atmel AT32UC3A3256 microcontroller 64MBit SDRAM Analog input (to ADC) Temperature sensor RC filter

Interfacing Analog to Digital Data Converters

Computer Automation Techniques. Arthur Carroll

Cellphone Based Device Control With Voice Acknowledgement

STM32L. Ultra-low-power Cortex -M3 devices

ABB Drives. User s Manual HTL Encoder Interface FEN-31

ADVANCED FIRE ALARMING SYSTEM THROUGH MOBILE PHONE

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

KTA-223 Arduino Compatible Relay Controller

HT46R14A Single Phase AC Induction Motor Frequency Converter Application

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

3. Identification of water pumps through RFID technology. 4. Wireless control of remote water pump using RF technology.

MIDECO 64-outputs MIDI note decoder USER MANUAL. Roman Sowa 2012

STEPPER MOTOR SPEED AND POSITION CONTROL

DESIGN OF 6 DOF ROBOTIC ARM CONTROLLED OVER THE INTERNET

DKWF121 WF121-A B/G/N MODULE EVALUATION BOARD

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

2013 G Miller. 3 Axis Brushless Gimbal Controller Manual

ARRL Morse Code Oscillator, How It Works By: Mark Spencer, WA8SME

HARDWARE MANUAL. BrightSign HD120, HD220, HD1020. BrightSign, LLC Lark Ave., Suite 200 Los Gatos, CA

BrightSign Expander Hardware Guide

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

The Quadcopter Controller

_ v1.0. EVB-56x Evaluation & Development Kit for Motorola PowerPC MPC56x Microcontrollers USERS MANUAL. isystem, February /8.

EasyPIC4 User s Manual

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

Introducing AVR Dragon

8-bit Atmel with 8KBytes In- System Programmable Flash. ATmega8 ATmega8L. Summary

AN2680 Application note

2.0 Command and Data Handling Subsystem

Welcome to the tutorial for the MPLAB Starter Kit for dspic DSCs

Chapter 6 PLL and Clock Generator

PCAN-MicroMod Evaluation Test and Development Environment for the PCAN-MicroMod. User Manual. Document version ( )

Chapter 13. PIC Family Microcontroller

Electronic Rotary Table Divider V2.1 Construction

GLOLAB Universal Telephone Hold

ENGI E1112 Departmental Project Report: Computer Science/Computer Engineering

User Manual. AS-Interface Programmer

Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

USER MANUAL V5.0 ST100

RF CONTROLLED VEHICLE ROBOT WITH METAL DETECTOR

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

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

Cornerstone Electronics Technology and Robotics I Week 15 Voltage Comparators Tutorial

Micro-Step Driving for Stepper Motors: A Case Study

8051 MICROCONTROLLER COURSE

Keywords: GPS, GSM, AVR Microcontroller, SMS.

Transcription:

1 USER MANUAL FOR ATMEGA 16/32 ROBOTICS MINI DEVELOPMENT BOARD V2.0 USING AVR STUDIO ------------------------------------------------------------------------------------------------------------------------------- Note: This tutorial is for the novice user. It shows how to set up AVR Studio 4.x and WinAVR so that C/C++ Source files will be compiled using GCC. For further information on AVR Studio, AVR Libc, GCC, AVR ISP, AVR JTAG ICE, and other tools please refer to the documentation which is also installed on the installation. Procedure described here is followed. -------------------------------------------------------------------------------------------------------------------------------

2 Table of Contents 1. Introduction... 3 2. Features... 4 3. Introductions to AVR Series (ATmega16) microcontroller... 5 3.1.Overview... 5 3.2.Pin Out of Atmega 16... 5 3.3.Pin Descriptions... 6 4.Introductions to Motor Driver... 7 4.1.H-Bridge... 7 4.2.L293D Dual H-Bridge Motor Driver... 8 4.3.Pin Diagram of L293D... 8 4.4.Interfacing... 9 5. Block Diagram of Development Board Connected... 10 6. Block Description of Development Board Connected... 11 7. Precautions... 12 8. Starting AVR Studio... 13 8.1.Writing your first C program... 13 8.2.Compilation of your first C program... 14 9. Dumping Program in Development Board Connected... 15 10. Connecting peripherals with Atmega 16/32 Robotics Mini Development Board V2.0... 20 10.1.DTMF Decoder module... 20 10.2.Sound Sensor... 20 10.3.Light Sensor... 20 11. Study of some C program using Loops and variables... 21 11.1.Blinking LEDs... 21 11.2.Line follower Robot program... 22

3 1. Introduction Robots and robotic technologies have an intellectual and emotional appeal that transcends any other type of engineered product, and this appeal is felt no more so than with children and young adults. Robots and robotic technologies represent a practical application of physics, computer science, engineering, and mathematics, and provide a very powerful and flexible approach to demonstrate a variety of engineering concepts. In addition, robotics appeals to a broad range of interests and allows multiple points of access to science, mathematics, and engineering for many types of learners. As a result, robotic technology and robots are being used by an increasing number of educators at the college level to reinforce computer science and engineering theory, and to teach basic software and mechanical engineering at the grammar school, middle school and high school levels. The giant strides that we have made in the areas of Communications and Computers are possible only because of the great successes that we have achieved in the field of Electronics. It is sometimes unbelievable, how many electronics gadgets that we carry these days in our person Digital Wrist-watch, Calculator, Cell-phone, Digital Diary or a PDA, Digital Camera or a Video camera, etc. The different type of Electronic equipments that has invaded our offices and homes these days is also mind boggling. Many things we use at home and office are remote controlled, for example, Television (TV), Air-Conditioners, Audio equipment, Telephone, etc. It is almost close to magic how even a child, now-a-days, can switch channels, or increase decrease the volume of sound in a TV at home by just clicking on a few buttons sitting at the comfort of a sofa away from the Television apparently without any physical wiring or connection! Again, we are astonished, how we are able to talk to our near and dear living several thousands of Kilometers away, from wherever we are, at home, office, on the road in a car, or in a classroom by just clicking a few n umbers on our palm sized cellular phones! Electronics has made deep impact in several vital areas such as health care, medical diagnosis and Treatment, Air and space travels, Automobiles, etc. In short, the technological developments of several countries of the globe are directly related to their strengths in electronics design, manufacture, products and services. Just as we teach physics, chemistry, biology and mathematics in our schools, it is high time we start teaching our children at school, Electronics as a separate subject by itself. This brings us face to face to an important question: How to teach the basic concepts of such an important subject like Electronics most effectively? If one wants to gain a good understanding of electronics, he or she should build circuits and test them independently. For this one should acquire a practical knowledge of the characteristics of different devices and in constructing the various circuits. Let us try to learn such skills by the proven scheme of LEARNING BY DOING. There is only one way to learn to do anything: and I found Robotics is the best way to learn all this. So let s start doing Robotics!!!

4 2. Features Programming through USB or 6-Pin ISP (In System Programming) cable. Driver Software not required (Plug& Play device). Four ports available for user interface. o PORTA-8 Pin, PORTB-8 Pin, PORTC-8 Pin, PORTD-8 Pin. Port for USART communication. 7 Channel 10 Bit ADC Port. External Reset Switch. On board crystal oscillator of 12 MHz frequency. Two supply inputso One through Battery and Second through Adapter. On board 5 volt regulated power supply from DC socket for the board and external peripherals. Two H-Bridge implemented on board using L293D IC to drive two DC motor with 1A drive current at voltages 4.5 to 36 volt. On board Slider Switch for Enabling Motors. On board HXD Piezo Buzzer for audio interface with the user. On board 16 x 2 LCD interface with variable Contrast. On board 8 bit LEDs for quick monitoring of Port Input / Output. Dedicated DTMF decoder module and Light searching Sensor Add on Shield. On Board 7 Bit Sensor interface for Robosapiens Sensor Module. On board Slider Switch for Boot Mode selection.

5 3. Introductions to AVR Series (ATmega16) microcontroller 3.1. Overview The ATmega16 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega16 achieves throughputs approaching 16 MIPS per 16 MHz allowing the designer to optimize power consumption versus processing speed. 3.2. Pin Out of Atmega 16

6 3.3. Pin Descriptions VCC: Digital supply voltage. GND: Ground. Port A (PA7-PA0): Port A is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port A output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port A pins that are externally pulled low will source current if the pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port A also serves the functions of various special features of the ATmega16. Port B (PB7-PB0): Port B is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port B also serves the functions of various special features of the ATmega16. Port C (PC7-PC0): Port C is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. If the JTAG interface is enabled, the pull-up resistors on pins PC5 (TDI), PC3 (TMS) and PC2 (TCK) will be activated even if a reset occurs. Port D (PD7-PD0): Port D is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port D also serves the functions of various special features of the ATmega16. RESET: Reset Input. A low level on this pin for longer than the minimum pulse Length will generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a reset. XTAL1: Input to the inverting Oscillator amplifier and input to the internal clock operating circuit. XTAL2: Output from the inverting Oscillator amplifier.

7 AVCC: AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter. AREF: AREF is the analog reference pin for the A/D Converter. 4. Introductions to Motor Driver Whenever a robotics hobbyist talk about making a robot, the first thing comes to his mind is making the robot move on the ground. And there are always two options in front of the designer whether to use a DC Motor or a stepper motor. When it comes to speed, weight, size, cost... DC motors are always preferred over stepper motors. There are many things which you can do with your DC motor when interfaced with a microcontroller. For example you can control the speed of motor, you can control the direction of rotation, you can also do encoding of the rotation made by DC motor i.e. keeping track of how many turns are made by your motors etc. So you can see DC motors are no less than a stepper motor. In this part of tutorial we will learn to interface a DC motor with a microcontroller. Usually H- bridge is preferred way of interfacing a DC motor. These days many IC manufacturers have H-bridge motor drivers available in the market like L293D is most used H-Bridge driver IC. H- bridge can also be made with the help of transistors and MOSFETs etc. rather of being cheap, they only increase the size of the design board, which is sometimes not required so using a small 16 pin IC is preferred for this purpose. 4.1. H-Bridge

8 4.2. L293D Dual H-Bridge Motor Driver L293 series of chips are power H-bridge motor drivers. The L293D chip is in 16-pins dip packages, and has two h-bridge drivers. An H bridge is typically capable of running one DC motor bidirectional (forward, backwards, off), or two separate motors unidirectional (forward, off). Thus a L293 chip can run two motors bidirectional, or 4 unidirectional. 4.3. Pin Diagram of L293D

9 4.4. Interfacing

10 5. Block Diagram of Development Board Connected

11 6. Block Description of Development Board Connected

12 7. Precautions USB Boot loader must be used always. If kit is once programmed using ISP, USB Boot loader will Boot loading firmware will get erased and cannot be used for programming. Booting Mode must be selected using the Slider Switch before programming. Pin PD2 should not be used for interfacing as it is used for Boot loader. Novice users must not use ISP Programmer on this kit.

13 8. Starting AVR Studio 8.1. Writing your first C program /*****************************your first AVR project***************************/ #include<avr/io.h> int main(void) { //This program doesn t do anything. } /***********end of the program*************/ Write down the above code to your AVR studio Text Editor. See Screen shot of the same below.

14 8.2. Compilation of your first C program Press F7 key to compile your project or See screen shot to compile using GUI interface.

15 9. Dumping Program in Development Board Connected Step 1. Connect one end of your USB Cable with Computer s USB Port and connect other end with the development board.

16 Step 2. Click on to the button Find Device.

17

18 Step 3. Browse your.hex file to be flashed in the device.

19 Step 4. Finally click on to the write button to burn the.hex file in the MCU.

20 10. Connecting peripherals with Atmega 16/32 Robotics Mini Development Board V2.0 10.1. DTMF Decoder module PD4 PD5 PD6 PD7 VCC GND 10.2. Sound Sensor PD7 VCC GND 10.3. Light Sensor PD7

21 11. Study of some C program using Loops and variables 11.1. Blinking LEDs //Project name : Blinking LEDs // Designed By : ROBOMART // http://www.robomart.com /* Program for "Blinking LEDs" Connection settings of Kit LEDs---@--------------------->PB0-PB7 Buzzer------------------------>PB4 BOOT Loader Condition Check--->PA0 (If 0 boot loader section else program execution section of Flash memory) RESET------------------------>PIN 9 Crystal Oscillator (12MHz) ----->PIN 12 & 13 VB=Battery Supply VCC=regulated 5V+ Gnd= Ground (0V) */ #define F_CPU 120000000UL #include<avr/io.h> #include<util/delay.h> #include "robosapiens.c" int main(void) { DDRB=0b11111111; // PB0 - PB7 of PORTB are set as output. While (1) // infinite while loop { } } PORTB=~PORTB; Wait (0.5); //wait function defined in robosapiens.c file function argument: // time in second

22 11.2. Line follower Robot program //Project name : Black Line Follower Robot // Designed By : ROBOMART // http://www.robomart.com /* Program for "Robot Following Black Line" Connection settings of Kit LEDs---@------------------>PB0 PB7 Left Sensor---------------->PA4 Right Sensor-------------->PA5 Buzzer--------------------->PB4 SOUND SENSOR----------->PD6 RIGHT MOTOR (+)-------->PB3 RIGHT MOTOR (-)--------->PB2 LEFT MOTOR (-)----------->PB1 LEFT MOTOR (+)---------->PB0 BOOT Loader Condition Check----->PA0 (If 0 boot loader section else program execution section of Flash memory) RESET-------------------------->PIN 9 Crystal Oscillator-------------->PIN 12 & 13 VB=Battery Supply VCC=regulated 5V+ Gnd = Ground (0V) */ #include<avr/io.h> void main() { DDRA=0b00000000; DDRB=0b00011111; int ls=0, rs=0; //set PORTA as input port //PB0, PB1, PB2, PB3 as output port // define & initialize ls, rs integer as 0 to // acquire the left sensor status in ls and right sensor // status in rs While (1) // create infinite loop { ls=(pina&0b00100000); //acquire only left sensor status connected at PA5 rs=(pina&0b00010000); // acquire only right sensor status connected at PA4 continued

23 if((ls==0b00000000)&(rs==0b00000000)) //check sensor status for both sensor OFF { PORTB=0b00001111; //stop ls=0; //set sensor status off rs=0; //set sensor status off } if((ls==0b00100000)&(rs==0b00000000)) //check sensor status for left sensor=on and //right sensor=off { PORTB=0b00011000; //turn right and buzzer ON ls=0; //set sensor status off rs=0; //set sensor status off } if((ls==0b00000000)&(rs==0b00010000)) //check sensor status for left sensor=off and //right sensor=on { PORTB=0b00010001; //turn left and buzzer ON ls=0; //set sensor status off rs=0; //set sensor status off } if((ls==0b00100000)&(rs==0b00010000)) //check sensor status for both sensor ON { PORTB=0b00001001; //move forward ls=0; //set sensor status off rs=0; //set sensor status off } } }

24 Thanks for purchasing Atmega16/32 Robotics Mini Development Board V2.0 from