CS 478 – Introduction1 Introduction to Machine Learning CS 478 Professor Tony Martinez.
CE 478 Microcontroller Systems
description
Transcript of CE 478 Microcontroller Systems
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
CE 478Microcontroller Systems
http://www.cs.uwec.edu/~ernstdj/courses/ce478
Prof. Dan Ernst
Spring 2011
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
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 amFriday: 1 – 3 pmor by appointment
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Labs and EquipmentLabs 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.
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Grading*Grading*
Item Weight ====== =========Labs/Homeworks 30%Exams (2) 30% (15% midterm; 15% final)Project 30%Quizzes 10%
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Final ProjectFinal 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
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
What we will cover*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.
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
AdministriviaAdministriviaP122 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
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
General Purpose ComputersGeneral Purpose Computers
• Microcomputers are computers based on microprocessors– General purpose microcomputers
• PC’s, Macs, etc.– Generally require a large amount of
support circuitry• Memory, communications, I/O, keyboard,display...
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Inside a General Purpose ComputerInside a General Purpose Computer
CPU RAM ROMPCIBusBridge
Address Bus
Data Bus
PCI Bus
Clock,Resetcircuitry
Control Bus
Real-timeClock
DiskController
DiskInterface
VideoMemory
VideoDisplayController
Serial Interface
ParallelInterface
...
Keyboard/MouseController
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Does One Size Fit All?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
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Embedded SystemsEmbedded 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?
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Needs of Typical Embedded SystemsNeeds 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)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
So…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
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Why PCs Aren’t Practical for EverythingWhy 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.
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
ASICs: The Other End of the Spectrum 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)
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
FPGA – a middle solution?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
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
The Spectrum of Hardware/Software SolutionsThe Spectrum of Hardware/Software Solutions
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Why Consumer Electronics make MoneyWhy 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
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
A Generic MicrocontrollerA Generic Microcontroller
Small CPU Core8-32 Bits2-40 MHz
FlashEEROM
2KB – 256KB
RAM256B – 64KB
GPIO
ADC8-14 Bits
Timer16-32 Bit
RS232/USB
I2C/SPIMemory Bus
16-24 Bits
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
Embedded SystemsEmbedded SystemsDefinition:
• 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
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
How are things controlled?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
CS 478: Microcontroller SystemsUniversity of Wisconsin-Eau Claire Dan Ernst
What we will cover*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