230 likes | 458 Views
CE 478 Microcontroller Systems. Spring 2011. Prof. Dan Ernst. http://www.cs.uwec.edu/~ernstdj/courses/ce478. Welcome. Class overview Policies etc. What are embedded systems? Why are they interesting? Why are they needed? Note: There is no required textbook for this class! Office hours:
E N D
CE 478Microcontroller Systems Spring 2011 Prof. Dan Ernst http://www.cs.uwec.edu/~ernstdj/courses/ce478
Welcome • Class overview • Policies etc. • What are embedded systems? • Why are they interesting? • Why are they needed? • Note: There is no required textbook for this class! Office hours: Wednesday: 9 – 11 am Friday: 1 – 3 pm or by appointment
Labs and Equipment • Fridays are Lab days in P 122. (not 171!) • There may be some exceptions (watch your e-mail!) • In labs you will sometimes be in groups of 2 • Equipment needs to stay in the lab area.
Grading* Item Weight ====== ========= Labs/Homeworks 30% Exams (2) 30% (15% midterm; 15% final) Project 30% Quizzes 10%
Final Project • Final Project will involve constructing a “polished” digital system • Implement the hardware and software involved in your design • Ideas and examples of projects are/will be posted on the class website • Project will involve multiple phases • Proposal • Implementation • Presentation/Documentation
What we will cover* • PowerPC architecture and assembly language • Bus protocols and interfacing • Including P6, PPC, and maybe others • Digital design review • Common I/O devices • Timers, A/D converters, serial I/O, etc. • Interrupts • I/O devices demanding attention • Direct Memory Access (DMA): • I/O devices talk directly to memory • Memory technologies: SRAM, DRAM, Flash etc • Analog to digital and back again. • Error correction and other “special” topics.
Administrivia P122 access: You’re welcome to work in P122 on 478-related projects anytime, except Weds. 2 – 4 pm and Tues. 3:30 – 5:30 pm ( CS 278 lab) If you can avoid it, don’t leave the boards out – there will be plenty of cabinet space, and other classes (CS 278) need to use the space. You will receive a key to the cabinets on the first lab day. Please don’t distribute the access code, or let in extra people! http://www.cs.uwec.edu/comdistro
General Purpose Computers • Microcomputers are computers based on microprocessors • General purpose microcomputers • PC’s, Macs, etc. • Generally require a large amount ofsupport circuitry • Memory, communications, I/O, keyboard,display...
Address Bus Data Bus Control Bus PCI Bus Serial Interface Disk Controller Video Memory Parallel Interface Real-time Clock Keyboard/MouseController ... Disk Interface Video Display Controller Inside a General Purpose Computer PCIBusBridge Clock,Resetcircuitry ROM CPU RAM
Does One Size Fit All? • Advantages of a general-purpose computer • Flexible - can run lots of programs and interface with lots of devices • Expandable - can be updated with new hardware • Cost-effective - the cost of adding a new program is small • Economy of scale - millions are being produced… • Disadvantages • Must be a “super” system, capable of running any program • High price • Relatively large, short battery life
Embedded Systems • Embedded Systems are small, special-purpose computer systems • Rocket guidance systems • Toaster control systems • Handheld electronics • Toys • Only the necessary parts are included • Cheaper, smaller • Simpler --> more reliable?
Needs of Typical Embedded Systems • Consider the following embedded systems: • Programmable thermostat • Blood Glucose Meter • iPod Touch™ • Automobile System Controller • Single-purpose • Small • Inexpensive • Reduced computation needs (most of the time) • Special interfaces • Lightweight (often hand held)
So… • You don't need a traditional user interface to decide which programs should be running • You don't need to dynamically load programs into your devices • You don't need to waste time waiting for the O/S to load • if one is needed, then it doesn't have baggage that make it slow to load • You don't need to load programs or data from a slow disk drive - most information needed will be in fast ROM
Why PCs Aren’t Practical for Everything • What does it take to build a blood glucose meter using a typical PC microprocessor? • 1 Intel/AMD/other CPU • Dynamic RAM, controller • ROM (one or two chips) for program • Real-time clock • LCD panel • Serial interface ports, drivers • A/D Converter • Random support chips (five or six chips) • This is going to take around 5+ chips, use > 100 W, and cost > $400.
ASICs: The Other End of the Spectrum • Since consumer electronics are made to do one thing, we should just be able to hardwire a solution! • Construct an ASIC (Application-Specific Integrated Circuit) • Custom chip that does a single thing, but does it VERY well! • Very little need for software support • Downside: making a custom mask will cost you a fortune • Lots of engineering design time • At least $10,000 up front to make a mask • $$$ to reserve time in the fab (or build your own fab)
FPGA – a middle solution? • Could use an Field-Programmable Gate Array (FPGA) • (a la 278) • Advantages: • Programmable • Much cheaper than ASICs • (at least in small quantities) • Disadvantages: • Not as intuitive as software • Still not super-cheap • Take up a lot of space/power relative to the capability they bring
The Spectrum of Hardware/Software Solutions Flexibility Price and/or Performance Full-Custom ASIC Digital Signal Processor Embedded MicroController High-Performance MicroProcessor "Application-Specific Processor"
Why Consumer Electronics make Money • A Microcontroller is a small CPU with support devices built into the chip • Small CPU • Small ROM • RAM, EEPROM • Parallel ports • RS232 ports • A/D Converter • Timer • Typically, a microcontroller uses little power and costs $0.50 to $100.00
A Generic Microcontroller FlashEEROM2KB – 256KB RAM256B – 64KB Timer16-32 Bit Small CPU Core8-32 Bits 2-40 MHz ADC8-14 Bits RS232/USB GPIO I2C/SPI Memory Bus16-24 Bits
Embedded Systems Definition: • Dedicated to controlling a specific real-time device or function • Self-starting, not requiring human intervention to begin. The user cannot tell if the system is controlled by a microprocessor or by dedicated hardware (or magic!) • Self-contained, with the operating program in some kind of non-volatile memory
How are things controlled? • Switches • Switches can be used to switch things on or off e.g. lights can be on or off • They can also be used to switch between values e.g a heater can be set to a number of values • Sensors • Sensors can tell if something is on or off • Sensors can tell you the value of something e.g. temperature • Timers • Timers can control the duration of other activities, such as how long a light is on, or the time between ADC samples • Analog controllers • Things such as voltage can be set for analog devices such as motors
What we will cover* • PowerPC architecture and assembly language • Bus protocols and interfacing • Including P6, PPC, and maybe others • Digital design review • Common I/O devices • Timers, A/D converters, serial I/O, etc. • Interrupts • I/O devices demanding attention • Direct Memory Access (DMA): • I/O devices talk directly to memory • Memory technologies: SRAM, DRAM, Flash, etc. • Analog to digital and back again. • Error correction or other “special” topics