INTERFACING HARDWARE WITH MICROCONTROLLER

Similar documents
VLSI Design Lab., Konkuk Univ. Yong Beom Cho LSI Design Lab

Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system.

The Atmel ATmega328P Microcontroller

The Atmel ATmega168A Microcontroller

Robotics Training Module ABLab Solutions

AVR Training Board-I. VLSI Design Lab., Konkuk Univ. LSI Design Lab

Lecture 14. Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Robosoft Systems in association with JNCE presents. Swarm Robotics

ARDUINO MEGA INTRODUCTION

AC : INFRARED COMMUNICATIONS FOR CONTROLLING A ROBOT

Microprocessors And Microcontrollers (Practical)

Embedded programming, AVR intro

Arduino Uno R3 INTRODUCTION

Module 2: Introduction to AVR ATmega 32 Architecture

Arduino Smart Robot Car Kit User Guide

TEVATRON TECHNOLOGIES PVT. LTD Embedded! Robotics! IoT! VLSI Design! Projects! Technical Consultancy! Education! STEM! Software!

COMP2121: Microprocessors and Interfacing. I/O Devices (I)

Lab Course Microcontroller Programming

CN310 Microprocessor Systems Design

DEV-1 HamStack Development Board

ET2640. Unit 5:ADVANCED I/O TECHNIQUES Pearson Education, Inc. Pearson Prentice Hall Upper Saddle River, NJ 07458

SECURE DIGITAL ACCESS SYSTEM USING IBUTTON

M32 Development Board

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

AVR Microcontrollers Architecture

CHAPTER 1 - World of microcontrollers

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

Doc: page 1 of 8

INDUSTRIAL TRAINING:6 MONTHS PROGRAM TEVATRON TECHNOLOGIES PVT LTD

CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK

LED Matrix Scrolling using ATmega32 microcontroller

GUIDE TO SP STARTER SHIELD (V3.0)

Embedded ROBOTICS. A 15 days program on Embedded Systems & Robotics Development with Microcontroller Technology & Image Processing

3 PHASE FAULT ANALYSIS WITH AUTO RESET FOR TEMPORARY FAULT AND TRIP FOR PREMANENT

AVR- M16 development board Users Manual

Mega128-DEVelopment Board Progressive Resources LLC 4105 Vincennes Road Indianapolis, IN (317) (317) FAX

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6

8051 Microcontroller

ECE 353 Lab 4. General MIDI Explorer. Professor Daniel Holcomb Fall 2015

1. Introduction Packing list Parts Introduction Uno R3 Board for Arduino Specifications... 6

MICROCONTROLLER BASED AUTOMATIC PLANT IRRIGATION SYSTEM

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1

Workshop on Microcontroller Based Project Development

ATmega128. Introduction

AVR XMEGA TM. A New Reference for 8/16-bit Microcontrollers. Ingar Fredriksen AVR Product Marketing Director

MICROPROCESSOR BASED SYSTEM DESIGN

Wasp Embedded Controller

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad

Bolt 18F2550 System Hardware Manual

Doc: page 1 of 6

LAMPIRAN. Universitas Sumatera Utara

Cerebot Nano Reference Manual. Overview. Revised April 15, 2016 This manual applies to the Cerebot Nano rev. A

Cricket Embedded Processor Dual H-Bridge/Bipolar Stepper Controller

PART 1 : MR-162. PART 2 : CPU Board. PART 3 : Software Tools. PART 4 : Compile and Download. 1. Introduction 2. Features

Introduction to Embedded Systems

Lecture (02) PIC16F84 (I)

Ryan Everaert Application Note Team - I Application Note for Toshiba Bipolar Stepper, Part Number TB6560AHQ

EE 109 Unit 4. Microcontrollers (Arduino) Overview

keyestudio Keyestudio MEGA 2560 R3 Board

Alessandra de Vitis. Arduino

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)

MP6500 Stepper Motor Driver, Digital Current Control

Basic Input/Output Operations

MICROCONTROLLER BASED SMART FAN SYSTEM

MegaAVR-DEVelopment Board Progressive Resources LLC 4105 Vincennes Road Indianapolis, IN (317) (317) FAX

ARM HOW-TO GUIDE Interfacing Stepper Motor with LPC2148

Embedded Systems and Kinetic Art. CS5968: Erik Brunvand School of Computing. FA3800: Paul Stout Department of Art and Art History.

Logistics. Embedded Systems. Kinetic Art. This Class. Embedded Systems and Kinetic Art. Kinetic Art

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Control System Implementation

Programming Microcontroller Assembly and C

Arduino Smart Bluetooth Robot Car Kit User Guide

ATMega128 Rapid Robot Controller Board [RKI-1148]

1/Build a Mintronics: MintDuino

Doc: page 1 of 6

EE 308: Microcontrollers

3.3V regulator. JA H-bridge. Doc: page 1 of 7

Power Supply, Arduino MEGA 2560, and Stepper Motors Connections

Clock and Fuses. Prof. Prabhat Ranjan Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.

Rhino Robot Control Board [RKI-1550]

ET-BASE AVR ATmega64/128

Academic Year Annexure I. 1. Project Title: Color sensor based multiple line follower robot with obstacle detection

DTMF BASED HOME AUTOMATION

acret Ameya Centre for Robotics & Embedded Technology Syllabus for Diploma in Embedded Systems (Total Eight Modules-4 Months -320 Hrs.

Laboratory 1 Introduction to the Arduino boards

Electronic Control systems are also: Members of the Mechatronic Systems. Control System Implementation. Printed Circuit Boards (PCBs) - #1

Embedded Systems and Software

An Arduino Controlled 1 Hz to 60 MHz Signal Generator

UNIT 10: Driving motors

C and Embedded Systems. So Why Learn Assembly Language? C Compilation. PICC Lite C Compiler. PICC Lite C Optimization Results (Lab #13)

Interconnects, Memory, GPIO

TECHNICAL REFERENCE BSD V-3A Bipolar Stepper Driver

Mega128-Net Mega128-Net Mega128 AVR Boot Loader Mega128-Net

World Scientific Research Journal (WSRJ) ISSN: Design and Implementation of Stepper Motor Control System Based on 52 MCU

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

Instruction Manual for BE-SP3 Circuit. 10/21/07

Various power connectors. 3.3V regulator. 64K Flash (Internal) 2K EEPROM (Internal) 4K SRAM (Internal) JA Mem Adr/ Data. Doc: page 1 of 9

Applications of 8051 Microcontrollers

Transcription:

INTERFACING HARDWARE WITH MICROCONTROLLER P.Raghavendra Prasad Final Yr EEE

What is a Microcontroller? A microcontroller (or MCU) is acomputer-on-a-chip. It is a type of microprocessor emphasizing self- sufficiency and cost-effectiveness effectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC). The only difference between a microcontroller and a microprocessor is that a microprocessor has three parts - ALU, Control Unit and registers (like memory), whilethemicrocontroller has additional elements like ROM, RAM etc.

ATMEGA32/ATMEGA32L High-performance, Low-power AVR 8-bit Microcontroller Up to 16 MIPS Throughput at 16 MHz 32K Bytes of In-System Self-Programmable Flash 1024 Bytes EEPROM 2K Byte Internal SRAM Two 8-bit Timer/Counters, One 16-bit Timer/Counter In-System Programming by On-chip Boot Program Four PWM Channels 8-channel, 10-bit ADC Programmable Serial USART Internal Calibrated RC Oscillator External and Internal Interrupt Sources Power-on Reset 32 Programmable I/O Lines

ATMEGA32/32L ATMEGA16/16L 32K Bytes of Flash memory 1024 Bytes EEPROM 2K Byte Internal SRAM 16K Bytes of Flash memory 512 Bytes EEPROM 1K Byte Internal SRAM

ATMEGA32/16 ATMEGA32L/16L Operating Voltage 4.5-5.5 V Operating Voltage 2.7-5.5 V Speed Grades 0 16 MHz Speed Grades 0 8 MHz

Pin Diagram

COMPUTER C - CODE COMPILER c HEX - CODE MICRO CONTROLLER

STK200 Cable

Configuring PORT PINS Each PORT consists of three registers DDRX (Data Direction Register) PORTX PINX Where X = A, B, C, D

DDRX The DDXn bit in the DDRx Register selects the direction of pin n. IfDDXniswrittenlogicone,PXnisconfiguredasanoutputpin. If DDXn is written logic zero, PXn is configured as an input pin. Where n = 0,1,2 ---,7 For Example If DDRA = 0x0F ( 0000 1111) The Lower bytes of PORTA are configured as output pins The Higher bytes of PORTA are configured as input pins

PORTX When PORTXn is configured as Input Pin Writing logic ONE to this pin, activates pull-up resistor. Writing logic ZERO to this pin, deactivates pull-up resistor When PORTXn is configured as Output Pin Writing logic ONE to this pin, drives the port pin HIGH Writing logic ZERO to this pin, drives the port pin LOW

PINX PINXn is used to read the value of particular port pin Independent of the setting of Data Direction bit DDRXn, the port pin can be read through the PINXn Register bit

ICCAVR ICCAVR, the ImageCraft s C Development Environment is a program for developing AVR microcontroller applications using the ANSI standard C language Full featured 30-day demo program can be downloaded from the ImageCraft web site www.image-craft.com

Getting Started with ICCAVR 1. Project>New 2. Project name and path 3. Project>Options 4. In the Compiler options, check Accept C++ Comments and Intel HEX as the output format 5. In the Target options, select ATmega32/Atmega16 under Device Configuration 6. Write the source code 7. Add the source file to the project by selecting Project>Add File(s) and select the file just written 8. Compile by selecting Project>Make Project or by clicking on the build icon 9. Open AVR ISP and download the hex file generated by ICCAVR, It is stored under the project name.

Sample program to generate Square wave on PORTA of ATMEGA32 #include<iom32v.h> #include<macros.h> Void delay(unsigned int i) { unsigned int k; While(i--) For(k=0;k<=500;k++); } Void main() { DDRA = 0xFF; // Configures PORTA Pins as Output pins While(1) { PORTA=0xFF; Delay(500); PORTA=0x00; Delay(500); }}}

Interfacing with Microcontroller LED Switches DC Motor Sensors Stepper Motor

LED Light Emitting Diode Maximum potential ti drop across LED will be approximately 2V. Maximum current tat can be allowed through am LED is approximately 30ma. Resistor should be added in series with LED to limit the current through it.

Calculating LED resistor value R = (Vs VL )/I Vs = supply voltage VL = Voltage drop across LED ( around 2V) I = 15 to 30 ma

LED s connected to 1. PORTA0 2.PORTB0

LED BLINK PROGRAM

DC Motor DC Motors are small, inexpensive and powerful motors used widely. These are widely used in robotics for their small size and high energy out. A typical DC motor operates at speeds that are far too high speed to be useful, and torque that are far too low. Gear reduction is the standard method by which a motor is made useful. Gear s reduce the speed of motor and increases the torque

Choosing a DC Motor DC Motor with Gear head Operating voltage 12V Speed Depends on our application Some available speeds in market 30 RPM 60 RPM 100 RPM 150 RPM 350 RPM 1000 RPM

Drive basics of DC Motor Red wire Black wire Direction of rotation Positive Negative Clock wise Negative Positive Anti clock wise Logic Logic Direction 1 0 Clock 0 1 Anti clock

Bi-Direction control of DC Motor H-Bridge Ckt using transistors for bidirectional driving i of DC motor Direction Clock wise Anti Clock wise Pulse to A and C B and D

H-Bridges in IC s to reduce the drive circuit complexity The most commonly used H-Bridges are L293D and L298 L293D has maximum current rating of 600ma L298 has maximum current rating of 2A Both has 2 H-Bridges in them These are designed to drive inductive loads such as relays, solenoids Can be used to drive 2 DC motors or 1 stepper motor

DRIVING OF DC MOTOR

Switches Active Low When pressed shorts the corresponding pin to ground Active high When pressed shorts the corresponding pin to Vcc

Active low Active high

INTERFACING SWITCHES

Sensors Commonly used sensors in the field of robotics are IR Digital sensors IR analog sensors

IR Digital sensors Transmitter IR led connected to 38KHz oscillator Receiver TSOP1738 IR Analog sensors Transmitter IR LED Receiver IR Photodiode

IR Analog sensor

STEPPER MOTOR STEPPER MOTOR is a brushless DC motor whose rotor rotates in discrete angular increments when its stator windings are energized in a programmed manner. Rotation occurs because of magnetic interaction between rotor poles and poles of sequentially energized stator windings. The rotor has no electrical windings, but has salient and/or magnetized poles.

4 Lead stepper 5 Lead stepper 6 Lead stepper 8 Lead stepper

Full Step driving of Stepper Motor Full step wave drive 4 3 2 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 www.raghu.co.in

Full Step driving of Stepper Motor Full step 2 phases active 4 3 2 1 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 1 www.raghu.co.in

Half Step driving of stepper motor 4 3 2 1 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 0 0 0 1 1 0 0 1

Choosing a Stepper motor 12 V operating voltage 1.8 degree step 6 Lead 250 t0 500 ma of current or Coil resistance of 20 ohms to 40 ohms Size and shape depends on application In most of the robotics cube shaped motors are preferred with frame size of 3.9 to 4 cm

Commonly used IC s for driving Stepper motor ULN2803 It has 8 channels It channel has maximum current rating of 500ma can be used to drive 2 unipolar stepper motors L293d L297 & L298

ULN2803

Bi Polar driving of Stepper Motor A B C D 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 1

DRIVING STEPPER MOTOR

Line Follower sensor1 sensor2 L 2 9 3 D Left motor Right Mt Motor sensor3 Microcontroller

You can download this presentation at