CSE466 Autumn ‘00 Misc.  Card Key Access…See Kathleen Goforth  Mail Archive…working on it…are you getting my messeges?  Why do we connect the speaker.

Slides:



Advertisements
Similar presentations
The 8051 MicroController In this module, we will be discussing the MCS-51 family of microcontroller, in particular the 8051, which is the generic IC representative.
Advertisements

8086 [2] Ahad. Internal! External? 8086 vs _bit Data Bus 20_bit Address 8_bit Data Bus 20_bit Address Only external bus of 8088 is.
Parul Polytechnic Institute
Autumn 2012C.-S. Shieh, EC, KUAS, Taiwan1 The 8051 Family Microcontroller Chin-Shiuh Shieh Department of Electronic Engineering.
Week10 Boolean Instructions on the Boolean Instructions  Boolean (or Bit) addressable capability is unique to the 8051  Enables efficient handling.
Chapter 2 HARDWARE SUMMARY
8051 Core Specification.
CSE Fall Introduction - 1 Architecture Overview (Start here on Fri)  Architecture (Harvard v. Princeton)  Program Memory (ROM)  External.
CSC Timers Since this is a microcontroller it mainly finds itself in embedded devices Quite often embedded devices need to synchronize events The.
Grading Lab reports: 10pts each. Demo required Homeworks: 3 points each (will be scaled by difficulty) Ratios –Lab: 25% –Homework 25% –Quizzes total 25%
Micro-controller or embedded controller
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
Microcontroller Intel 8051
Microcontroller 8051.
The 8051 Microcontroller architecture
Micro controllers A self-contained system in which a processor, support, memory, and input/output (I/O) are all contained in a single package.
MCU – Microcontroller Unit – 1 MCU  1 cip or VLSI core – application-specific.
Objectives How Microcontroller works
Embedded Systems Design 1 Lecture Set 6 I/O Ports.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
MOBILE OPERATING ROBOT ON EMBEDDED SYSTEM
CoE3DJ4 Digital Systems Design Hardware summary. Microprocessors vs. Microcontrollers Microprocessors are single-chip CPU used in microcomputers Microcontrollers.
An Introduction to Microcontroller (Hardware Specification) Lec note 4
Microcode Source: Digital Computer Electronics (Malvino and Brown)
MICROCONTROLLERS 8051.
8051 Micro controller. Architecture of 8051 Features of 8051.
PHY 201 (Blum)1 Microcode Source: Digital Computer Electronics (Malvino and Brown)
8085. Microcomputer Major components of the computer - the processor, the control unit, one or more memory ICs, one or more I/O ICs, and the clock Major.
Microcontrollers Class : 4th Semister E&C and EEE Subject Code: 06ES42
CSE466 Autumn ‘00 Review  Card Key Access…See Kathleen Goforth  Mail Archive…working on it…are you getting my messeges?  Why do we connect the speaker.
Lecture Set 4 Programming the 8051.
Microcontrollers. An embedded microcontroller is a chip which a computer processor with all it’s support functions (clocking and reset), memory, and i/O.
Intel 8051 Another family of microcontroller is the Intel 8051 family. The basic 8051 microcontroller has four parallel input/output ports, port 0, 1,
INTRODUCTION TO PIC MICROCONTROLLER. Overview and Features The term PIC stands for Peripheral Interface Controller. Microchip Technology, USA. Basically.
Microcontroller Intel 8051 [I/O Ports]. Pin out of the 8051 –40 pin package –32 pins are used for the 4 ports. –V CC / V SS –ALE Address Latch Enable.
Presented by Sadhish Prabhu
Microprocessors CSE 341 Lecture Md. Omar Faruqe UB 1228
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
EE/CS-352: Embedded Microcontroller Systems Part V The 8051 Assembly Language Interrupts.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Chapter Microcontroller
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
MICROCONTROLLER INTERFACING WITH STEPPER MOTOR MADE BY: Pruthvirajsinh Jadeja ( ) COLLEGE:DIET BRANCH:EC.
HJD Institute of Technical Education & Research- Kera(Kutch) The 8051 Microcontroller architecture PREPARED BY: RAYMA SOHIL( )
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.
Dr. Iyad Jafar Introducing the PIC 16 Series and the 16F84A.
The 8051 Microcontroller architecture
8051 Pin - out PORT 0 PORT 1 PORT 2 PORT 3.
80C51 Block Diagram ECE Overview.
Classification of Instruction Set of 8051
Architecture Overview (Start here on Fri)
IPCOWALA INSTITUTE OF ENGINEERING & TECHNOLOGY-DHARMAJ
Lecture Set 5 The 8051 Instruction Set.
Subroutines and the Stack
The 8051 Family Microcontroller
Data Processing Instructions
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
The 8051 Assembly Language Arithmetic & Logic Instructions
(Electrical Engg 6th Semester)
Subroutines and the Stack
Microcontroller 8051 Made By: Arun Branch. 4th Sem. I&C Engg.
8051 Microcontroller.
First Design Key board R L S.
Important 8051 Features On chip oscillator 4K bytes ROM 128 bytes RAM
UNIT-VIII 8051 Microcontroller Architecture Register set of 8051
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
Subroutines and the Stack
MCU – Microcontroller Unit – 2
Presentation transcript:

CSE466 Autumn ‘00 Misc.  Card Key Access…See Kathleen Goforth  Mail Archive…working on it…are you getting my messeges?  Why do we connect the speaker to 5V instead of ground?  Frequency range … what did you discover?  Debugger – shows you elapsed simulation time, can set watch variables, etc, etc. Learn more about the debugger!  Speaker power

CSE466 Autumn ‘00 Simple Princeton Architecture ALU ROM Linear Address Space W/ Mem Mapped IO PCSPGPRsIR mux Control IR I/O Port Timer, SFR’s Status Reset Vector Interrupt Vect RAM address data

CSE466 Autumn ‘00 Analysis  Bottleneck into and out of memory for data and code  Use of critical 8-bit address space (256) for memory mapped I/O and special function registers (timers and their controllers, interrupt controllers, serial port buffers, stack pointers, PC, etc). For example, the Motorola 6805 processor has only 187 RAM locations.  But, easy to program and debug. Compiler is simple too.

CSE466 Autumn ‘ : Modified Harvard Architecture ALU PC Internals Control Status Reset Vector Interrupt Vect RAM SFR’s (direct) Usually Stack (indirect) Bit Addressable Reg. Banks address mux data (indirect or Direct) 8051 standard + Enhancements PSW – 2-bits bank sel. 4x8 instruction 3 bits reg sel bits of reg. addr

CSE466 Autumn ‘ Memory Architecture  Advantages  Simultaneous access to Program and Data store  Register banks great for avoiding context switching on interrupt and for code compression  8-bit address space extended to = 384 registers by distinguishing between direct and indirect addressing for upper 128 bytes. Good for code compression  Bit addressable great for managing status flags  Disadvantage  A little bit confusing, with potential for errors.

CSE466 Autumn ‘00 Segments control address space…same in C NAMEexample PROGSEGMENTCODE CONSTSEGMENTCODE VAR1SEGMENTDATA BITVARSEGMENTBIT STACKSEGMENTIDATA RSEG BITVAR ; relocatable segment flag:DBIT 1; single bit variables RSEG VAR1 ; relocatable segment ih:DS 1; integer i is two bytes il:DS 1 RSEG STACK ; relocatable segment DS 10H ; 16 Bytes CSEG AT 0 ; absolute segment JMP START ; Execution starts here on reset. RSEG PROG ; relocatable segment START:MOV SP,#STACK-1 ; first set Stack Pointer MOV PSW,#00 ; use register bank O ;rest of main program here what would you add to include an interrupt routine? CSEG AT 0BH rti

CSE466 Autumn ‘00 Instruction Execution  6 States/Machine Cycle,  2 Osc. Cycles/State = 12 Cycles/Machine Cycle  Most instructions are 1 machine cycle, some are 2 or more  Can make two ROM accesses in on memory cycle (two byte/one cycle instructions, such as ADD A,#10H.  ALE – address latch enable, used when referencing external memory which can happen twice per machine cycle.  Its a Micro-coded CISC processor (sort of an old architecture)  Interesting features  No Zero flag (test accumulator instead)  Bit operations, Bit accessible RAM  Read Modify Write operations (ports)  Register to Register Moves  Multiply and Divide operations (many 8-bit MCU’s don’t have these)  Byte and Register Exchange operations  Register banks  Data pointer registers  Addressing Modes (careful when using upper 128 bytes of RAM)  BCD oriented instructions

CSE466 Autumn ‘00 Assembly Programming  Declare Segments and Segment types  Segments define what address space you are in.  Assembler converts to machine code, with relocatable segments.  Linker perform absolute code location  Segments  DATA -- Internal Data Address Space (0-7F direct or indirect)  IDATA -- Indirect Data Address Space (80-FF for stack, arrays) –Address is in R0 or R1  BIT – Bit addressable RAM space  XDATA -- External Data Address Space  CODE – Internal or external code space  CONST – Internal or external code space  Example Assembly Program

CSE466 Autumn ‘00 Last Term’s Lab MCU Atmel 89C55 +5V P2 Resistor Pack +5V Value on DIP switch controls LED frequency GND, VCC, XTAL, EA, Reset P1.1

CSE466 Autumn ‘00 Anatomy of an Assembly Program unsigned char i; void main (void) { register unsigned int tmp; while (1) { P1^= 0x01; i = 0; do { tmp = i; i += P2; } while (tmp < i); } Look for overflow in C – difficult to do Note i is global and tmp is local. What happens to local variables? How are registers used? What happens in a subroutine call? refer to C51 Manual in Keil (under the books tab, lower left) do { i += P2; } while (!CY)

CSE466 Autumn ‘00 Optmized Compiler Result ; FUNCTION main (BEGIN) ?C0001: XRL P1,#01H CLR A R MOV i,A ?C0005: MOV R7,i MOV R6,#00H MOV A,P2 ADD A,i MOV i,A MOV R5,A CLR C MOV A,R7 SUBB A,R5 MOV A,R6 SUBB A,#00H JC ?C0005 SJMP ?C0001

CSE466 Autumn ‘00 Now in Assembly RSEG PROG ; first set Stack Pointer START:MOV SP,#STACK-1 MOV PSW,#00 ; SET TO REG BANK O CLR flag ; just for show SETB flag ; just for show LOOP1:CLR C; Clear carry MOV A,il ; get low byte ADD A,P2; increment MOVil,A JNC LOOP1 ; loop until carry INC ih ; increment hi byte MOV A,ih ; check if zero JNZ LOOP1 ; XRL P1,#01H SJMP LOOP1 END NAMELab1_00sp PUBLICil PUBLICih PROGSEGMENTCODE ;CONSTSEGMENTCODE VAR1SEGMENTDATA BITVARSEGMENTBIT STACKSEGMENTIDATA RSEG BITVAR flag:DBIT 1 RSEG VAR1 ih:DS 1 il:DS 1 RSEG STACK DS 10H ; 16 Bytes CSEG AT 0 USING 0 ; Register-Bank 0 ; Execution starts at address 0 on power-up. JMP START

CSE466 Autumn ‘00 Embedded Hardware  Microcontrollers  Smallest: PIC 8-Pin (8-bit) PIC 8-pin MicrocontrollerPIC 8-pin Microcontroller  Middle: 6805 (8 bit) Example Flash Based 8051Example Flash Based 8051  Many 16-bit DSP Microcontrollers  HW support for MAC, Filter Algorithms  High End: StrongArm (32 bit) IntelIntel  Compare to pentium  External memory  Data Address Multiplexing  Memory Mapped I/O – talking to external devices  Typical Devices  Resistive Sensors (Strain, Temp, Gas, etc.)  Motion sensors (accelerometer)  Valve  Motor (Stepper, DC, Servo)\  Speaker  LCD Display  LED  Latches  Gas Sensors

CSE466 Autumn ‘00 Reset processor 1ms after powerup  1ms = 1/32 sec ~ 31ms  Let R = 10K, so C =.031/10K = 3.1uF RST 10K 3.2u what is the waveform on RST?

CSE466 Autumn ‘00 An output port Write Reg Pin bus

CSE466 Autumn ‘00 What’s Inside the Buffer? IhIh IlIl Write Reg This device always “drives” either high or low. Current is a function of pin voltage Never High Impedence ‘Z’ Note: this one inverts the signal, but its just an example…