Introduction to AVR Name : 1) Abhishek Yadav 130360111001 2) Prakash Giri 130360111002 3) Kheni Niral 130360111003 4) Bhadresh Langadiya 130360111004 Branch.

Slides:



Advertisements
Similar presentations
Introduction to Micro-controllers Anurag Dwivedi.
Advertisements

Microcontroller Fundamentals
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
Engineering 4862 Microprocessors Lecture 23 Cheng Li EN-4012
Robotics Club, Snt Council2 The 3 Schools of Robotics: Mechanical Design – Types of motors – Material selection –
MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable.
Programming Microcontrollers B. Furman 19MAR2011.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
Programming the ATmega16
Programmable System on Chip Fully Configurable Mixed Signal Array Allows for Completely Customizable System Designs Capable of Internal MCU.
Sensors And Micro-Controllers
Essentials of motors and motor driver
Robotics Research Laboratory Louisiana State University.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Indian Institute of Technology Hyderabad PC CONTROLLED BOT D. HARISH KUMAR CE12B1005 N. ABHINAND SAI CS12B1027 G.NITiSH EE12B1008.
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.
Microprocessor Block Diagram
PIC microcontrollers. PIC microcontrollers come in a wide range of packages from small chips with only 8 pins and 512 words of memory all the way up to.
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.
328eForth for Arduino Uno C. H. Ting February 16, 2012 SVFIG.
AVR Microcontrollers.
Arduino Josh Villbrandt February 4, Digital Circuits Analog versus digital – What’s the difference? – How to represent an analog signal in a computer?
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.
Parallel Ports, Power Supply and the Clock Oscillator Material to be covered  Parallel I/O ports  Interfacing external switches and LEDs  Clock Oscillator.
By, Prof. Tambe S. S. S.N.D. College of Engineering and Research Center Department of Electrical Engineering.
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
One of the most important feature of the microcontroller is a number of input/output pins used for connection with peripherals. In the case of PIC 167CX,
EGRE 6311 Midsize Microcontrollers and Microprocessors The 8051 is an example of a small inexpensive microcontroller intended for simple applications.
بسمه تعالي AVR Microcontrollers. The ATmega8 Basic Features -1.
1 LHO 13 The 8051CF020 and the University Daughter Card.
Atmel Atmega128 Overview ALU Particulars RISC Architecture 133, Mostly single cycle instructions 2 Address instructions (opcode, Rs, Rd, offset) 32x8 Register.
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.
Microcontrollers Class : 4th Semister E&C and EEE Subject Code: 06ES42
INTRODUCTION TO PIC MICROCONTROLLER. Overview and Features The term PIC stands for Peripheral Interface Controller. Microchip Technology, USA. Basically.
Microcontroller Programming
智慧電子應用設計導論(1/3) Arduino MEGA 2560
DsPIC30F4011 Fall DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
Features of the PIC18 microcontroller - 8-bit CPU - 2 MB program memory space (internal 32KB to 128KB) bytes to 1KB of data EEPROM - Up to 4096 bytes.
Arduino Mega Arduino Mega 2560 Arduino Mega 2560.
AVR Architecture Prepared By: Avdhesh Soni ( ) Sarthak Patel ( ) Akshay Parekh ( ) Fenil Sachla ( ) Guided.
NAM S.B MDLAB. Electronic Engineering, Kangwon National University 1.
Modified Harvard architecture 8-bit RISC single chip microcontroller Complete System-on-a-chip On Board Memory (FLASH, SRAM & EEPROM) On Board Peripherals.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
INTERFACING HARDWARE WITH MICROCONTROLLER GUIDED BY: Prof. ASIF SIR 1. AKSHAY KIRAN 2. DEEP PARIKH 3. JIGAR PATEL 4. TILAK PATEL ,05,D2D06,09.
ALPHA COLLEGE OF ENGINEERING & TECHNOLOGY Introduction to AVR ATMega32 Architecture PREPARED BY SHWETA ( ) BHOOMI ( ) YOGEN ( )
Popular Microcontrollers and their Selection by Lachit Dutta
AVR I/O Port Programming
Embedded Systems Programming
PROGRAMMABLE LOGIC CONTROLLERS SINGLE CHIP COMPUTER
Fundamentals of Computer Engineering
C. K. Pithawalla College of Engineering and Technology, Surat
AVR ATMEGA 8 MICRO-CONTROLLER
COMP2121: Microprocessors and Interfacing
The 8255 Programmable Peripheral Interface
The Arduino Microcontroller: Atmel AVR Atmega 328
Introduction to Microprocessors and Microcontrollers
I/O Ports in AVR Sepehr Naimi
Parallel communication interface 8255
Tim Sumner, Imperial College, Rm: 1009, x47552
Architectural Overview
I/O Ports in AVR Sepehr Naimi
AVR – ATmega103(ATMEL) Architecture & Summary
Decoding and Using a 4x4 Keyboard
8051 Micro Controller.
Decoding and Using a 4x4 Keyboard
Presentation transcript:

Introduction to AVR Name : 1) Abhishek Yadav ) Prakash Giri ) Kheni Niral ) Bhadresh Langadiya Branch : Electronics & Communication Faculty : 1) M.D.VEKARIYA

Features of AVR (ATmega32) Harvard architecture 8 bit Microcontroller High performance - 16MHz Large program memory EEPROM – non volatile memory Two 8 bit, One 16 bit timer with total 4 PWM channels On chip 10 bit ADC, 8 channels UART, I2C, SPI protocol support

Tools Compiler : WinAVR/AVR Studio/CodeVision AVR The programmer hardware - Simple parallel/serial port based In System Programmer (ISP) or - USB based ISP (recommended) : USBasp Bread board, wires, power supply, crystal, etc.

Points to be noted PORT : group of 8 pins, or set of pins used for exchanging data with external world Width of almost all registers : 8 bits (some 16 bits) In port related registers, every bit corresponds to one pin of the port. Bit 0 corresponds to Pin 0 Bit 0 corresponds to Pin 1.. Etc Remember direct one to one correspondence between HEX and BINARY numbers. 0xFF = xAA = x11 =

Input/Output Basics Three registers : - DDRx : for configuring Data Direction (input/output) of the port pins. - PORTx:for writing the values to the port pins in output mode. Configuring the port pins in input mode. - PINx:reading data from port pins in input mode Where x : A,B,C,D… depending on the available ports in your AVR.

DDR – Data Direction Register Configures data direction of the port - Input / Output DDRx.n = 0 > makes corresponding port pin as input DDRx.n = 1 > makes corresponding port pin as output Examples : to make all pins of port A as input pins : DDRA = 0b ; to make all pins of port A as output pins DDRA = 0b ; to make lower nibble of port B as output and higher nibble as input DDRB = 0b ;

PIN register Used to read data from port pins, when port is configured as input. First set DDRx to zero, then use PINx to read the value. If PINx is read, when port is configured as output, it will give you data that has been outputted on port. There two input modes : - Tristated input - Pullup input This will be explained shortly Example : DDRA = 0x00; //Set PA as input x = PINA; //Read contents of PA

PORT register Used for two purposes … 1) for data output, when port is configured as output: Writing to PORTx.n will immediately (in same clock cycle) change state of the port pins according to given value. Do not forget to load DDRx with appropriate value for configuring port pins as output. Examples : to output 0xFF data on PB DDRB = 0b ;//set all pins of port b as outputs PORTB = 0xFF; //write data on port to output data in variable x on PA DDRA = 0xFF; //make port a as output PORTA = x; //output 8 bit variable on port

PORT register 2) for configuring pin as tristate/pullup, when port is configured as input) : When port is configures as input (i.e DDRx.n=1), then PORTx.n controls the internal pull-up resistor. PORTx.n = 1 : Enables pullup for nth bit PORTx.n = 0 : Disables pullup for nth bit, thus making it tristate Examples : to make PA as input with pull-ups enabled and read data from PA DDRA = 0x00; //make port a as input PORTA = 0xFF; //enable all pull-ups y = PINA; //read data from port a pins to make PB as tri stated input DDRB = 0x00; //make port b as input PORTB = 0x00; //disable pull-ups and make it tri state

What is pull-up ? Pull-up resistor is used to ensure that tri-stated input always reads HIGH (1) when it is not driven by any external entity. Pull-up is very important when you are using tri-stated input buffers. Tri-state input pin offers very high impedance and thus can read as logic 1/ logic 0 because of minute static charges on nearby objects. Pin state changes rapidly and this change is unpredictable. This may cause your program to go haywire if it depends on input from such tri-state pin.

Input/Output Basics Summary register bits → pin function↓ DDRx.nPORTx.nPINx.n tri stated input00read data bit(s) x = PINx.n; y = PINx; pull-up input01read data bit(s) x = PINx.n; y = PINx; output1write data bit(s) PORTx.n = x; PORTx = y; n/a Following table lists register bit settings and resulting function of port pins

I/O Basics – Exercise 1.Configure PB as output port 2.Configure PC as tri-stated input and read value into variable x. 3.Configure PA as pullup input and read lower nibble into variable y and higher nibble into variable x. 4.Make higher nibble of PA as pullup inputs and lower nibble as output. 5.Read, only input pins of above mentioned port and get the binary number present on those pins into variable x. 6.Write four bit number 0x5 onto output pins of above mentioned port