150 likes | 449 Views
What to Look for in a Microcontroller. MAS.863 November 2, 1999 MIT Media Lab. What is a Microcontroller? . Small, lightweight CPU Some Families: PIC SH1 ADuC812 68HC11. What you get. Simple hardware to software interface In situ processing (on a PCB, shoe, etc) Less ICs.
E N D
What to Look for in a Microcontroller MAS.863 November 2, 1999 MIT Media Lab
What is a Microcontroller? • Small, lightweight CPU • Some Families: • PIC • SH1 • ADuC812 • 68HC11
What you get • Simple hardware to software interface • In situ processing (on a PCB, shoe, etc) • Less ICs
What you don’t (usually) get • Limited speed • < 5 MIPS • Limited RAM • < 256 bytes • Limited Program storage: • < 4K words
Features (or lack thereof) • Basic features • Hardware UART • ADC/DAC • Interrupts • Flash Programmable • CISC vs. RISC
Basic Features • I/O Pins • Usually digital, some analog (see later) • Timers • 8 or 16 bit (maybe watchdog) • x Bit operations • Usually 8, makes 16 (and greater) bit operations slow • External Addressing • Gives ability to add extra RAM
Hardware UART • Allows for serial line communications • Can be mimicked in software, but: • Slower • Uses a timer • Cannot trigger interrupt
ADC/DAC • Analog to Digital / Digital to Analog Conversion • Usually 8 bit (up to 16 bits) • Usually 20us per sample (down to 5) • Can be multiplexed
Interrupts • Allow non-linear program flow based on external events • Based on: • Pin change • Serial event • Power low (etc) • Can wake processor • Hard to debug
Flash Programmable • As opposed to UV erasable • Faster prototyping • Usually not available with ADC
CISC vs. RISC • CISC • Different instruction sizes and execution times • Easier to write assembly language by hand • RISC • All instructions same size and (almost) same execution time • Compiler can usually create smaller code • Much easier cycle counting
PIC • Usually: • 18 - 28 pin packages (down to 8) with 14-22 I/O • ADC available, usually 4 channels, 8 bits • Max. 5 MIPS • Hardware UART on heavier chips • No external addressing • Excellent general purpose chips • Ubiquitous around the Lab
SH1 (eg) • Lots of: • Speed (20 MIPS) • Bits (32) • RAM (8K) • 16 bit timers (5) • Interrupts (40) • Power drain (100 mA) • Pins to solder (100)
ADuC812 • Fast (5 us) 8 channel, 12 bit ADC • Hardware UART • Flash • But: • CISC • 1.25 MIPS max • Still good for data collection, smart sensor type application
68HC11 • 8 channel, 8 bit ADC • 20K program, 1K RAM • 5 16-bit timers • 38 I/O pins • UART • 24 bit external memory space • But: 3 MHz clock