Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Lecture #1 Outline Welcome Back AVR Hardware –Pins and Ports.

Slides:



Advertisements
Similar presentations
COMP3221: Microprocessors and Embedded Systems
Advertisements

Parul Polytechnic Institute
Chapter 2 HARDWARE SUMMARY
8051 Core Specification.
Introduction of Holtek HT-46 series MCU
Mark Neil - Microprocessor Course 1 Timers and Interrupts.
COMP3221: Microprocessors and Embedded Systems--Lecture 8 1 COMP3221: Microprocessors and Embedded Systems Lecture 8: Program Control Instructions
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
COMP3221: Microprocessors and Embedded Systems
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
Embedded Systems Overview
Rabel Talpur:12BME#025.  40-pin chip  Developed by Motorola in 1975  16 address lines and 8 data lines  Used only +5V.
Micro controllers A self-contained system in which a processor, support, memory, and input/output (I/O) are all contained in a single package.
Atmega32 Architectural Overview
AVR Microcontrollers.
A Few Words From Dilbert
1 Lecture 1: Embedded Systems Overview, AVR Hardware/Software Introduction.
Embedded System Design Laboratory October 11, 2002Stanford University - EE281 Lecture #4#1 Lecture #4 Outline Announcements Project Proposal AVR Processor.
Embedded System Design Laboratory October 4, 2002Stanford University - EE281 Lecture #3#1 Lecture #3 Outline Announcements AVR Processor Resources –UART.
بسمه تعالي AVR Microcontrollers. The ATmega8 Basic Features -1.
Introduction to AVR Chapter 1
Atmel Atmega128 Overview ALU Particulars RISC Architecture 133, Mostly single cycle instructions 2 Address instructions (opcode, Rs, Rd, offset) 32x8 Register.
Computer Architecture Lecture 03 Fasih ur Rehman.
Architecture and instruction set. Microcontroller Core Features:  Operating speed: DC - 20 MHz clock input DC ns instruction cycle Up to 8K x.
Intel 8051 Another family of microcontroller is the Intel 8051 family. The basic 8051 microcontroller has four parallel input/output ports, port 0, 1,
Timers and Interrupts Mark Neil - Microprocessor Course.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
1 Lecture 1: Embedded Systems Overview, AVR Hardware/Software Introduction.
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.
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
ECE 447 Fall 2009 Lecture 4: TI MSP430 Architecture and Instruction Set.
COMP3221: Microprocessors and Embedded Systems--Lecture 10 1 COMP3221: Microprocessors and Embedded Systems Lecture 10: Shift and Bit-set Instructions.
An Adder A Subtractor. A and B are the inputs of the adder/ subtractor R is the output of the adder/ subtractor F is the control to tell it to add or.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Embedded Systems Lecture 5 January 25 th, 2016.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
AVR Architecture Prepared By: Avdhesh Soni ( ) Sarthak Patel ( ) Akshay Parekh ( ) Fenil Sachla ( ) Guided.
Vadodara Institute of Engineering Subject: Microcontroller interfacing Prepared by: Bipin Malani ( ) Vishwa Pandit ( ) Branch : Electronics.
80C51 Block Diagram 1. 80C51 Memory Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits – i.e. addresses for only 256.
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
“ INSTRUCTIONS SET OF AVR MICROCONTROLLER ” SIGMA INSTITUTE OF ENGINEERING Prepared By: SR.NO NAME OF STUDENT ENROLLMENT 1 Abhishek Lakhara
Embedded Systems Programming
COMP2121: Microprocessors and Interfacing
Introduction to Smart Systems
C. K. Pithawalla College of Engineering and Technology, Surat
Microcontrollers & GPIO
Overview of Architecture Assembly Programming Concepts
MCI PPT AVR MICROCONTROLLER Mayuri Patel EC-1 5th sem
BITS EDU. CAMPUS , VARNAMA
Overview of AVR Hardware/Software Introduction
AVR Addressing Modes Subject: Microcontoller & Interfacing
Introduction of microprocessor
Microcomputer Programming
8085 microprocessor.
UNIT 5 TIMRERS/COUNTERS
Atmega32 Serial Programming Basics
The Arduino Microcontroller: Atmel AVR Atmega 328
ATmega103 Timer0 and Interrupts
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Introduction to Microprocessors and Microcontrollers
Memories.
Tim Sumner, Imperial College, Rm: 1009, x47552
Architectural Overview
Addressing Modes Register Direct, with 1 and 2 registers I/O Direct
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
COMP3221: Microprocessors and Embedded Systems
Computer Operation 6/22/2019.
Presentation transcript:

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Lecture #1 Outline Welcome Back AVR Hardware –Pins and Ports AVR Programming –AVR Memory and Addressing Modes –AVR Instruction Set –Timers Project Ideas

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Survey: Have you… Subscribed to the list? Started on Lab #0 Yet? Started on Lab #1 Yet? Got access to the EE281 lab yet? Got your account set up on the lab machines? Read over the AVR Instruction Set? Played with AVR Studio? Simulated blink.asm?

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Lab Kits: STK500 for all Get these items after class –Atmel AVR STK500 The AT90S8515 processor Configurable options: –Port connections (LEDs and switches) –Supply Voltage (*be careful) –Processor frequency –Atmel Web Site CD (everything and more) –Power Transformer –Databook (*while they last)

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Software Notes AVR Studio 4.0 –The only software you need for the STK500 Works as editor for Assembly and C Has built-in AVR assembler Has built-in AVR simulator Has built-in STK500 programmer PonyProg2000 –Don’t need it for the STK500 –But…it’s perfect for programming your final project!

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR AT90S8515 Pinout General Purpose Ports –PORTA –PORTB –PORTC –PORTD –(Special Functions) Special Purpose Pins –Crystal (XTAL1/XTAL2) –RESET –ICP, OLE, OC1B Power (VCC/GND)

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 ‘8515 Functional Architecture 32 Registers (R0- R31) 4K Prog ROM 512 bytes RAM 512 bytes EEPROM 32 I/O lines 13 Interrupts Lots of fun built-in peripherals

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR Memory Spaces Program Flash –Vectors, Code, and (Unchangeable) Constant Data Working Registers –Includes X, Y, and Z registers. I/O Register Space –Includes “named” registers SRAM – Data Space –Runtime Variables and Data –Stack space EEPROM space –For non-volatile but alterable data

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR Data Memory Map: Part 1

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR Data Memory Map: Part 2

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR I/O Memory Map Peripherals and Ports are I/O mapped Use IN/OUT instructions to access Excerpt from I/O map showing ports:

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR Addressing Modes Register Direct, with 1 and 2 registers I/O Direct Data Direct Data Indirect –with pre-decrement –with post-increment Code Memory Addressing

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Register Direct: 1 Register Examples: INCR16 CLRR22 EORR0

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Register Direct: 2 Registers Examples: ADDR16,R17 CPR22,R5 MOVR0, R1

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 I/O Direct Examples: INR16,PIND OUTPORTC,R16

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Data Direct Examples: STS0x1000,R16

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Data Indirect Examples: LDR16, Y STZ, R16

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Data Indirect w/ Displacement Examples: LDDR16, Y+0x10 STDZ+0x20, R16

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Data Indirect: Pre-Decrement Examples: LDR16, -Z ST-Z, R16

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Data Indirect: Post-Increment Examples: LDR16, Z+ STZ+, R16

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Prog. Memory Addressing Examples: LPM

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Indirect Program Addressing Examples: IJMP ICALL

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Relative Program Addressing Examples: RJMP RCALL

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 I/O Register $3F : SREG All Bits are R/W: –I – Global Interrupt Enable –T – Bit Copy Storage –H – Half Carry Flag –S – Sign Bit –V – Two’s Complement Overflow Flag –N – Negative Flag –Z – Zero Flag –C – Carry Flag

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Instruction Examples: Add Math –Add ADD Rd, Rr – Adds two registers –Rd <- Rd + Rr ADC Rd, Rr – Add with Carry two registers –Rd <- Rd + Rr + C ADIW Rdl, K – Add Immediate to Word –Rdh:Rdl <- Rdh:Rdl + K

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Other Math and Logic Subtract Logical AND Logical OR Exclusive OR One’s Complement Two’s Complement Increment/Decrement Set/Clear Registers and Bits in Registers

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Branch Instructions RJMP/RCALL – Relative Jmp (+/-k) IJMP/ICALL – Indirect Jmp (Z Reg) RET/RETI – Return from call/interrupt CP* - Compare SB* - Skip if Bit in Register or I/O is set/clr BR* - Branch if condition is met

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Data Transfer Instructions MOV – Move between registers LD/LDI – Load / Load Immediate ST/STI – Store / Store Immediate LPM – Load Program Memory –Hardwired to load R0 with (Z) in code. IN/OUT – In and Out Ports PUSH/POP – On and off stack

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Bit and Bit Test Instructions SBI/CBI – Set / Clear Bit in register LSL/LSR – Logical Shift Left / Right ROL/ROR – Rotate Left / Right (thru Carry bit) ASR – Arithmetic Shift Right SWAP – Swap Nibbles BST/BLD – Bit Store / Load BSET/BCLR – Set / Clear Status Bits by number SE*/CL* - Set / Clear Status Bits by name

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Other Instructions NOP – Do nothing for 1 cycle SLEEP – Sleep until reset or interrupted WDR – Watch Dog Reset

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR Timer/Counter 0 8 Bit Wrap-Around Up Counter Interrupt on Overflow

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR Timer/Counter 0 (cont’d)

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR Timer/Counter 1 –16 Bit –Dual Comparators A,B (output captures) –Up Counter –Interrupt on: Overflow Compare A/B Input Capture of external event on ICP pin. –Can also act as an 8, 9 or 10 bit PWM Up- Down Counter.

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR Timer/Counter 1 (cont’d)

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Timer Control: I/O space Timer 0: –Control Register (TCCR0) –Timer/Counter0 (TCNT0) Timer 1: –Control Register A & B (TCCR1A/B) –Input Capture Register (ICR1) –Timer/Counter1 Output Compare Register A and B (OCR1A/B) –Timer/Counter1 (TCNT1) Timer Interrupt Registers (Mask and Flag Registers) are Common to Both Timers

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 AVR Timer/Counter Sources Shut Off CPU frequency divided by 1,8,64,256,1024 At 8MHz that’s: 1/8uS, 1uS, 8uS, 32uS, 128uS External Input (rising or falling).

Embedded System Design Laboratory September 27, 2002Stanford University - EE281 Lecture #1 Project Ideas? Automatic Timed Fish Feeder (extra credit :-) Laser Light Show Controller Animated Light Controller (stimulated by music?) Programmable Universal Remote Control Reactive Juggling Ball (accelerometers, FSR) Sports Car Performance Analyzer Very Small Web Server Communication Gadget Automated Remote Weather Station