EE4380 Microprocessor Design Project Fall 2002 Class 1 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas
Introduction What is a Microcontroller? Microcontroller Vs Microprocessor Level of Integration Cost Processor, memory, timer, UART, I/O ports etc System cost, per unit cost Application domain General purpose Vs specialized System design Issues 22-Aug-02 2
Embedded Systems Do one specialized task Efficiently Cost effective manner Microcontroller based system + Software Embedded software Usually small code footprint Assembly Language everywhere RTOS and HLLs are available Need special tools for development, debugging etc 22-Aug-02 3
Embedded Systems (contd.) Embedded system design is unique Normal software design usually targets fixed hardware gcc, gdb, gprof and you are (usually) done! Both hardware and software have to be engineered together Engineering decisions: Hardware/Software partitioning (open problem) Device/Peripheral selection (memory size, vendor etc) Software development environment 22-Aug-02 4
Embedded Systems Design Styles Full Manual Design hardware and software manually Vendor tool assisted flow Sophisticated (high $) CAD tools HLL compilers Simulators, source level debuggers, ICE etc Major engineering decisions are still manual Fully Automated Flow Wish list item #1 22-Aug-02 5
Review of Logic Circuits Hex system 1000 1010 0011 1111b = 8A3FH Hex arithmetic needed to calculate jump addresses Hex addition Simple TBT addition with 1 carry for every 16 Hex subtraction If subtrahend smaller than minuend then simple TBT subtraction Else, swap and then find 2 s complement of result 22-Aug-02 6
Review of Logic Circuits (contd.) Logic gates For loose random logic Inverter, AND, OR, XOR, NAND, NOR, Tri-state buffer Decoders Used for address decoding Sequential elements Used for demuxing address/data lines, latches etc Flip-flops, latches Edge and level triggered Discrete components TTL devices (74xxx series), CMOS devices (CD4000, 74C etc) Linear devices (Op-amps, regulators, etc) 22-Aug-02 7
Review of Logic Circuits (contd.) Common use of a decoder - Address generation Common use of a latch - Bus Demuxing ALE A0 A Y0 Device 1 AD0 A0 A1 A2 B C CE ADDRESS = 0H AD1 AD2 AD3 74LS573 A1 A2 A3 Y7 CE Device 2 D0 D1 74LS138 ADDRESS = 7H D2 D3 22-Aug-02 8
Digital Systems Controller path and Data path Controller controls the datapath at specific control points in the datapath Controllers are Finite State Machines (FSM) Controllers can be designed up from scratch or use a Microprocessor / Microcontroller Microprocessor based digital system controller design is essentially creating the software Microprocessors can also do some of the datapath s functions ALU units, IO units, special units for comm, dsp, etc 22-Aug-02 9
Digital Systems (contd.) Controller and Datapath Illustration External Control Lines Input Control Inputs Controller Datapath Output Status / Feedback 22-Aug-02 10
Overview of the 8051 Family One of the oldest (Intel MCS-51 in 1981) and probably the most popular microcontroller. Many derivatives are marketed by a number of vendors Common features, 8-bit processor 4 I/O ports each 8bits wide max of 64K on-chip ROM (usually 0k to 4k) max of 64K external data memory max of 64K external code memory 2 timers, one serial port 128 bytes of on-chip RAM various speeds from 12MHz Clones may have different on-chip memory, timers etc 22-Aug-02 11
8051 Block Diagram 22-Aug-02 12
8051 Pinout Diagram From Intel 87C51 datasheet DIP package Data lines and lower 8 address lines are muxed Two ports P0 and P2 are used by AD buses Clones may not be pin compatible 22-Aug-02 13
Some 8051 clones 8031 No on-chip ROM 8751 With on-chip EPROM 8052 8051 with 128 bytes extra IRAM, extra 16 bit timer, additional SFRs to use the timer Atmel AT89C51 With on-chip Flash ROM Dallas Semicondustor DS5000 On-chip NV-RAM and In system programmable via serial-port Philips Corp. 8051 cores from FPGA vendors Xilinx, Altera, etc 8051 with programmable logic Triscend etc 22-Aug-02 14
8051 Development System Components of a dev. System PCB board with microprocessor, memory, peripherals, I/O etc Development software Assemblers, compilers, debuggers, monitors, emulators, communication software, drivers Usually supplied by the vendor. Free and Open-source tools are also available. Common Features HW Prototyping facilities (free ports, address spaces, connectors, etc) Software design and testing Software download onto the dev. System and debugging Interface the Dev. System with a host PC for download and debugging 22-Aug-02 15
8051 Dev. System Paulmon System Easy to use Low-cost 8051 dev. System 87C52 at 22 MHz, 50 IO lines, LCD interface, 32K RAM, 30K Flash, Paulmon2 monitor, two serial ports, 8 LEDs Hardware prototyping area AS31 assembler, SDCC C compiler Source code available for monitor Complete Schematic available From: http://www.pjrc.com/tech/8051/board4/index.html 22-Aug-02 16
8051 Dev. System - Monitor Think Mini Operating System Runs at startup (power-on) Provides a serial comm link to a Host PC. Terminal emulators (hyperterminal, minicom, seyon etc) can be used to talk with the monitor Provides facilities to download code and execute it Provides debugging facilities Has many functions that can be called by user programs as sub-routines Makes embedded system (HW and SW) design very easy and quick. 22-Aug-02 17
8051 Dev. System Home Brew Breadboard or Wire-wrap designs DS 5000 in system programmable Need only a crystal and a RS232 interface (MAX232) At power-on talks to Host PC and code can be downloaded Atmel 89C51(52) and other Flash based clones Reprogram with your code any number of times using a PROM programmer Design and etch your own PCB Use Flash based or ISP or Use external (E)EPROM Program the (E)EPROM with your code, using a PROM programmer. 22-Aug-02 18
Class-1 : Review What is an embedded system? Difference between Microprocessor and Microcontroller? What is embedded system design? How is microprocessor related to digital system design? What is an 8051? What is an 8051 development system? What are its components/features? What is a monitor? Why do you need it? How to home-brew an 8051 development system? 22-Aug-02 19
Class 1 : Thanks 22-Aug-02 20