Microcontroller Introduction ECE110 Lecture 1 John A. Chandy Adapted from Prof. Martin Fox s s ECE266 Notes
Agenda Course outline/ goals and approach Quick Overview of Computer Architecture Definition of Microcontrollers Components Microcontroller Market Key Suppliers
Introduction Basics of computer architecture How does a computer work? Microcontrollers, microprocessors and microcomputers Microcontrollers are general purpose digital logic replacements
Course goals Learn about microcontrollers Learn how to apply them in engineering applications Learn the basics of embedded systems Provide framework for future design lab courses
Basic Computer Architecture Control Logic R0 R1. Registers. Operand 1 Operand 2 ALU Accumulator. Instruction Register Results/data bus Instruction Memory I/O
State Machine representation of CPU Instruction Fetch Load Instruction Register Instruction Decode Save Result Memory Access Execute Fetch Operands
RISC Vs. CISC RISC = Reduced Instruction Set Computer CISC = Complex Instruction Set Computer Microcontrollers = mostly RISC Microcomputer for PC = x86 is CISC Pipelining = easier in RISC PIC = 35 instructions
Examples of Instructions: 1 Immediate: Add literal and w Register: AND W with F From: PIC data sheet
Assembly Language Human readable coding of machine language Assembler translates to binary Each line-> one instruction
Example of assembly Language program
Higher Level Languages Compiler translates from code to computer instruction set. Examples: Basic, Fortran, C, C++, Java Application packages: Mathematica, Mathcad, spreadsheets -> even higher level languages
Operating Systems Perform I/O I.e. printing, storage to disk Graphical user interface [GUI], I.e. Windows Virtual memory Resource sharing [allows multiple programs to be running at the same time] Network interface Security
Embedded Systems Dedicated computers for SMART applications Automotive: engine control, transmission control Microwaves, CDs, cellular telephones, remotes DSP: embedded controller optimized for math operations [multiplies, etc.] often used for image and sound processing
Summary We have given you a brief survey of computer and microprocessor essentials Computer engineers use microprocessors as part of larger devices, I.e. electronic and control systems [embedded computers] Such microprocessors can act as logic replacement devices Microprocessor-based systems are easier to document and upgrade because the design is in the [changeable] coding
Microcontrollers vs.. Microprocessors What is the difference between a microprocessor and a microcontroller? A microcontroller usually incorporates other specialized components that are useful in embedded systems Serial ports (RS-232, USB) Networking (WiFi( WiFi,, Ethernet, ZigBee) On-board memory (Flash, DRAM, SRAM) Audio (MP3 encoding, signal processing) Analog I/O (DAC, ADC)
Microcontrollers Overview Microcontrollers - a key impact technology for the 21st century Microcontrollers.com: In the aggregate, PC microprocessors are responsible for less than 1% of all processors sold. Embedded processors outsell PC processors by more than 99%. This course will provide enough information AND practical experience to get you started on the road to developing your own designs
Microcontrollers and Embedded Controllers Controls some process or aspect of the environment: Microcontrollers Vs. DSPs DSPs optimized for math [multiplies] Embedded controller may not be a microcontroller per se but is used for special purpose control application Typical applications: temperature control, smart instrument, GPS, digital lock, cell phone, etc.
Examples Personal information products: Cell phone, pager, watch, pocket recorder, calculator Laptop components: mouse, keyboard, modem, fax card, sound card, battery charger Home appliances: door lock, alarm clock, thermostat, air conditioner, tv remote, hair dryer, VCR, small refrigerator, exercise equipment, washer/dryer, microwave oven Toys; video games, cars, dolls, etc. Cars are about 20-30% silicon today, mostly microcontrollers ($4b/yr) Smart cards [credit cards plus] Usually anything with a keypad [simple calculators however have dedicated calculator chips]
Assignment 1: Due Next Thursday One page [no more] written assignment to be handed in. Find a microcontroller based device or product [i.e. Logitech optical computer mouse]. Determine what specific microcontroller is used in the device [i.e. PIC 16F874]. Explain the function or functions of the microcontroller in the device [i.e. converts pulses from rotary encoder to serial RS 232 communication protocol for transmission to computer input port]. Be prepared to present in class.
Microcontroller Families Most manufacturers offer a wide range of devices for low end to higher end applications Microchip shipped its 1 billionth microcontroller in the fall of 1999, the 2 billionth in spring of 2002, and its 3 billionth in winter of 2004.
Microcontroller Manufacturers Analog Devices Atmel Dallas Semiconductor Freescale Semiconductor Hitachi Semiconductor Intel Microchip National Semiconductor Renesas STMicro Texas Instruments Zilog
Microcontroller Market >40 suppliers, >50 architectures $26 Billion market Shipments- > 16 Billion in 2000, 8 bit > 1/2 market Major Players: Microchip 16Fxx, Intel 8051, Motorola MC68HCXX, National COP800, SGS/Thomson ST62, Zilog Z86Cxx
Microcontrollers Processing power: 4 bit, 8 bit, 16 bit, 32 bit 2003 market share Specific features: communications, keyboard handling, signal processing, video processing
Embedded Controller- components ALU (arithmetic logic unit) RAM (Random Access Memory) EEPROM (Electrically Erasable Programmable Read Only Memory) I/O (input/output) - serial and parallel Timers [typically three designated 0,1,2] A/D converter Clock USART [univ[ univ. synchronous/asynch receiver and xmtr] Interrupt controller [PIC16F874[ diagram]
16F87x Family: Features
16F874 Block Diagram
16F87x Instruction Set [35]
MPLAB IDE IDE = Integrated Development Environment MPLAB Editor MPLAB Assembler MPLAB ICD [in circuit debugger] MPLAB SIM [simulator] Programmer with ICD module
Blink.c Initial() Initialize internal registers Blink() Blink the LEDs LoopTime() Wait for 10 milliseconds interupt handler() Check for interrupts from buttons
Summary Microprocessors and embedded controllers are a ubiquitous part of life today These devices come in a wide variety of configurations and designs Headhunters report that EEs familiar with µc, µp design are in the highest possible demand One pager due next Lecture!
More Information In the next session we will explore in more depth key features of µcontrollers Boards and ICDs in lab. All major Manufacturers have web sites