MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable.

Slides:



Advertisements
Similar presentations
MICROPROCESSORS AND MICROCONTROLLERS
Advertisements

Introduction to Micro-controllers Anurag Dwivedi.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Robotics Club, Snt Council2 The 3 Schools of Robotics: Mechanical Design – Types of motors – Material selection –
Indian Institute of Technology Hyderabad ROBOTICS LINE FOLLOWER HARI KISHAN TANDEY – ES12B1008 DILIP KONDAPARTHI – ES12B1010 SAI KARTIK – CE12B1015.
LOGSYS Development Environment of Embedded Systems Tamás Raikovich Béla Fehér Péter Laczkó Budapest University of Technology and Economics Department of.
Microcontroller – PIC – 4 PIC types PIC architecture
Programming Microcontrollers B. Furman 19MAR2011.
Programming the ATmega16
Railway Foundation Electronic, Electrical and Processor Engineering.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Arduino DC motor driver L298 H-Bridge Arduino GUI vs Atmel Studio
Sensors And Micro-Controllers
Railway Foundation Electronic, Electrical and Processor Engineering.
Essentials of motors and motor driver
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Timers and Interrupts Shivendu Bhushan Sonu Agarwal.
You must be knowing about Digital Integrated Circuits (ICs) right ? For example 7404: Hex Inverter 7408: Quad 2-input AND gate 7410: Triple 3-input NAND.
Introduction to Microcontrollers Shivendu Bhushan Summer Camp ‘13.
Atmega32 Architectural Overview
AVR  Modern RISC architecture: Compact and FAST.  Tuned for high level languages.  Consistent architecture across entire line.  Small AVR are subsets.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
Embedded Systems Programming 1 ETEE 3285 Topic HW3: Coding, Compiling, Simulating.
AVR Microcontrollers.
I/O Ports CS-280 Dr. Mark L. Hornick 1. CS-280 Dr. Mark L. Hornick 2 Ports are channels from the CPU to external hardware and software Atmega32 has: 4.
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
Typical Microcontroller Purposes
1 Lab 1: Introduction. 2 Configure ATMEL AVR Starter Kit 500 (STK500), a prototyping/development board for Lab1. ATmega16 ( V) is the chip used.
Arduino 101 Instructors: Ted Markson / Jim Sweeney.
Microcontroller Presented by Hasnain Heickal (07), Sabbir Ahmed(08) and Zakia Afroze Abedin(19)
MICROPROCESSOR AND MICRO CONTROLLER
Atmel AVR Jared Bevis January 14, The Power of Your Chips The main power of your chips lies in the programming language/compiler available to you.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
AVR Programming: Digital I/O September 10, What is Digital I/O? Digital – A 1 or 0 Input – Data (a voltage) that the microcontroller is reading.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
INTRODUCTION TO PIC MICROCONTROLLER. Overview and Features The term PIC stands for Peripheral Interface Controller. Microchip Technology, USA. Basically.
TIMERS AND INTERRUPTS AVI SINGH KEVIN JOSE PIYUSH AWASTHI.
Lecture 7: Overview Microprocessors / microcontrollers.
Robocon 2007, Hong Kong University of Science & Technology Robocon 2007 Electronics Quickstart! Session 1 Hello! Microcontroller. Prepared by KI Chi Keung.
Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit.
Arduino Mega Arduino Mega 2560 Arduino Mega 2560.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
Components of a typical full-featured microcontroller.
MICROCONTROLLER INTERFACING WITH STEPPER MOTOR MADE BY: Pruthvirajsinh Jadeja ( ) COLLEGE:DIET BRANCH:EC.
AVR Architecture Prepared By: Avdhesh Soni ( ) Sarthak Patel ( ) Akshay Parekh ( ) Fenil Sachla ( ) Guided.
Introduction to AVR Name : 1) Abhishek Yadav ) Prakash Giri ) Kheni Niral ) Bhadresh Langadiya Branch.
Programming PIC 16F84A in Assembly. PIC16F84 pin-out and required external components.
Embedded C- Language Lets Learn fundamentals !!. An Embedded system is combination of computer hardware and software, and perhaps additional mechanical.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
1. PIC ADC  PIC18F877 has 8 analog input channels i.e. port A pins(RA0 to RA5) and port E pins(RE1 and RE2). These pins are used as Analog input pins.
INTERFACING HARDWARE WITH MICROCONTROLLER GUIDED BY: Prof. ASIF SIR 1. AKSHAY KIRAN 2. DEEP PARIKH 3. JIGAR PATEL 4. TILAK PATEL ,05,D2D06,09.
 Mini-Computer ◦ Microprocessor  The Brains  Arithmetic Logic Unit (ALU)  Control Unit  Program/ Data Storage  Peripherals (Input/Output)  Low-Cost.
Application Case Study Christmas Lights Controller
Arduino.
Lets Learn fundamentals !!
AVR I/O Port Programming
PROGRAMMABLE LOGIC CONTROLLERS SINGLE CHIP COMPUTER
Atmega32 Architectural Overview
Microcontrollers & GPIO
AVR ATMEGA 8 MICRO-CONTROLLER
DIGITAL CALCULATOR USING 8051
COMP2121: Microprocessors and Interfacing
Atmega32 Serial Programming Basics
The Arduino Microcontroller: Atmel AVR Atmega 328
Introduction to Microprocessors and Microcontrollers
AVR – ATmega103(ATMEL) Architecture & Summary
8051 Micro Controller.
Wireless Embedded Systems
Presentation transcript:

MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable – You can define what they do.  This is what makes them different from other simpler ICs, such as AND gates, inverters, etc  Logic tables relating Input and Output can be defined by you 3. Many useful features built in to the uC itself

ATMEGA KB Flash Memory… 40 pin U C… 32 I/O Pins These pins have other functions like UART, ADC, SPI, LCD, Interrupt, TIMERS, etc… But we will now focus on I/O and TIMER… Maximum Voltage 5V, current rating about 10 milli- amperes

Atmega8

I/O Pins: Setting Data Direction (I/O?): DDRX Register PORTX Register PINX Register

I/O Registers Input / Output is controlled through special variables called “registers”. Registers are actual hardware memory locations inside the μCs with predefined names and sizes. Assigning a value to these registers in the program changes the corresponding hardware configuration. And, these values can be altered multiple number of time at any point in the program. There are 3 registers that control the I/O pins: DDR, PORT and PIN. Each port has it’s own registers. Hence, DDRA, PORTA, PINA registers for port A; DDRB, PORTB, PINB for port B and likewise.

DDR(Data Direction Register) Decides whether the pin is Input or Output. DDR is an 8 bit register. Each bit corresponds to a particular pin on the associated port. If a bit on the DDR register is 0, then the corresponding pin on the associated port is set as input. Similarly, if the bit is 1, then the pin is set as output. If a pin is configured as input, then it has some floating voltage unless an external voltage is applied. For an output pin, the voltage is fixed to a particular value.

Setting Register Values MSB of DDRA corresponds to the pin A7. If DDRA = 0b , then:

PORT register PORT is also an 8 bit register. The bits on the PORT register correspond to the pins of the associated port in the same manner as in the case of the DDR register. PORT is used to set the output value. If the pin is set as output, then a PORT value of 1 will set voltage at that pin to 5V, and PORT value 0 sets the voltage to 0V. If the pin is configured as an input, PORT value serves the purpose of pull up or pull down.

PIN register PIN is a register whose value can be read, but cannot be changed inside the program. It gives the value of the actual voltage at a particular pin. 1, if the value at the required pinis 5V and 0 for 0V.

Summary

Tools Required -> CVAVR

Compiler -> CVAVR The code is written in C language so we need to convert it into the format that Atmega understands.

Transfer code to Atmega AVR Studio

Avr Programmer

So we need two softwares overall a) CVAVR –> Editor and Compiler b) Avr Studio –> Transfer Code to Atmega

While & For While (conditon) { …... } for(initialisation; condition; increment) { … … }

Lets Begin by blinking a simple LED

How to program a microcontroller: A microcontroller understands only binary language (0 and 1)…We write the code in C language in CVAVR (Compiler + IDE). We compile the code to generate the.hex file (which the machine understands) We transfer the.hex file to Atmega using a Programmer Hardware: Serial Programmer, STK 500, USB etc… (Contains chips to convert voltage levels and protocols) Software: AVR Studio, AVRDUDE, etc…

Programmer Pin connection with Atmega 8

How to Run Motors through U C? The Atmega16 has a current rating of 5-10 mA. The normal DC motor’s current ratings start from 150 mA and above. So the motor cannot be directly attached to the Atmega, hence a motor-driver is used… (eg: L293, L298, etc…)

TIMERS: Atmega has:  Timer 0, 8 bit (OC0 at PB3)  Timer 1, 16 bit (2 parts A and B each of 8 bit, OC1A at PD5, OC1B at PD4)  Timer 2, 8 bit (OC2 at PD7) There are 2 clocks:  System Clock (fs)  Timer Clock (ft = fs or fs/8 or fs/64 or ….)

(For generating 38 KHz in TSOP Sensors)

(For MOTORS)

NOW LET US HAVE A LOOK AT CVAVR AND AVR STUDIO AND HOW TO PRACTICALLY PROGRAM AN ATMEGA 16

THANK YOU