Presentation is loading. Please wait.

Presentation is loading. Please wait.

Choosing a Microcontroller Architecture

Similar presentations


Presentation on theme: "Choosing a Microcontroller Architecture"— Presentation transcript:

1 Choosing a Microcontroller Architecture
Selecting a 16-bit Microcontroller Feb 21, 2013 Bill Giovino

2 What You Will Learn Today
What exactly is a 16-bit Microcontroller? Why 16-bit microcontrollers are still going strong 16-bit Peripherals – faster, FASTER! When you need a 16-bit Selection Criteria

3 What is a 16-bit Microcontroller?
A 16-bit Microcontroller moves 16-bit data efficiently Modern 16-bit architecture takes one cycle to move 16-bit data from one location to another Modern 16-bit architecture takes one cycle to add two 16-bit numbers …and it takes more than one cycle to do the same with 32-bit data If it has a 16-bit datapath and a 16-bit ALU It’s a 16-bit microcontroller Duh If it has an 8-bit datapath and a 16-bit ALU It’s an 8-bit microcontroller Sometimes called an 8/16-bit microcontroller If it has a 16-bit datapath and a 32-bit ALU It’s a 16-bit Microcontroller Sometimes called a 16/32-bit Microcontroller Don’t get hung up on what it’s called, it’s what you do with it that counts.

4 Squeezing Between 8-bit and 32-bit
High Performance Register Based Higher cost compared to 8-bit Plenty of Communications stacks 16-bit Register-based Good Low Power 32-bit performance excluding math Plenty of communications stacks Lots of Communications Interfaces Ethernet, USB, CAN, etc 8-bit Low Power Lowest Cost Usually Accumulator Based Moderate Performance Moderate Communications Limited performance with 16-bit communications and stacks

5 16-bit Microcontrollers All About Embedded Communications
Stubborn fan base TI, Infineon, Renesas with strong 16-bit base More complex applications than 8-bit, but lower power than 32-bit Code is easier to write than an accumulator-based 8-bit because 16-bit is register based More on-chip resources and performance available to do on-chip debugging, run a monitor, set status pins, etc. Best balance of Low Power vs. Performance Driven by 1. Networking features Ethernet, USB, etc is all 16-bit 2. Price 3. Low Power (Great tools are assumed) Features more important than price A 16-bit core has more attractive ease-of-use for interfacing to networking peripherals than 8-bit

6 Example: 8-bit doing Ethernet
10/100BaseT Ethernet MAC (16-bit data) Runs O.K. at 10BaseT (10 Mb/s) Limited performance at 100BaseT (100Mb/s) because: 8-bit core moves 8-bit data Meanwhile, Ethernet peripheral is 16-bit data register 8-bit core is moving 16-bit data, which requires an EXTRA read, an EXTRA write – which slows the performance of the core down by as much as one-half Running at a faster clock speed increases power consumption Best compromise for low power is a 16-bit microcontroller

7 Popular 16-bit Microcontrollers This list is not complete – so don’t flame me
TI MSP430 – The Dominator Very Long history, Register based, Low Power Hugely loyal fan base Extremely popular Renesas M16C Long History, Register Based, Low Power Code compatible with the popular Renesas 8-bit R8C Infineon C166 & XC166 – The Boxers Register based, NOT Low-Power Lots of Flash Plenty of performance that competes easily with Cortex “More than 500 Million pieces sold” Microchip PIC24 – New Kid on the Block Register based, Very Low Power Wide selection in a short period of time Focused on embedded communications Freescale S12 – The Company Previously Known As Motorola Born of the aged 68HC11, Accumulator based, Low Power Popular 16-bit in Automotive

8 LOW POWER COMMUNICATIONS The Sweet Spot of the 16-bit Market
16-bit is the minimum core architecture size for effective networking Low Power 16-bit targets battery powered communications If battery powered, Low Power provides: Longer Battery Life Whether battery powered or not, Low Power always provides: Less Power => Less expensive voltage regulator Less Current => less Expensive PC board layout Less Heat => Increased MTBF Less Heat => Reduced cooling requirements (cheaper case design) Low Power is Relative "A toaster is lower power than a blast furnace" Low Power specs can be more important than price A cheap product that quickly drains the battery is too cheap People complain on online product reviews 16-bit lower power than 32-bit 32-bit toggles twice the data paths than 16-bit TI's MSP430 is one of the most popular (16-bit) cores BECAUSE it is “Ultra Low Power” Microchip strong in 16-bit with their “eXtreme Low Power” PIC24F

9 Low Power Consumption Important for many 16-bit applications
Battery powered - increases battery life Non-battery powered - increases system reliability Other advantages Uses inexpensive voltage regulator Minimizes required board space Eliminates heat sink or cooling fan

10 16-bit Pin Compatibility with 8-bit
Upgrade your 8-bit in the same socket Not all manufacturers have a pin-compatible 32-bit from their 8-bit Specifications change Your boss changes his mind The board is laid out and your system is more complex than you thought You can’t change your board and you need more: Memory Performance Features Magic smoke (just kidding) A pin-compatible 16-bit device saves your career “Pin Compatible” means: Same electrical characteristics Same peripherals, I/O, power pinout Same Vcc and GND pins

11 Look at the Peripherals
Provides specific hardware functionality that is too impractical to perform in software Two general types of peripherals Digital peripherals 16-bit Timers Serial I/O with 16-bit data registers I/O ports Analog peripherals 12-bit or 16-bit Analog-to-Digital (A/D) Converters 16-bit Digital-to-Analog (D/A) Converters A 16-bit microcontroller reads 12-bit and 16-bit ADC registers in one easy cycle

12 Common Microcontroller Peripherals
System Requirement Peripheral Benefit I/O Control I/O Pins with bit level control Direct interface to switches, actuators, and digital status signals Serial Peripheral Communications Serial ports: SPI, I2C, UART, CAN Hardware support for expansion and external device communications Precision control of actuators and motors Sophisticated timers and PWM modules Low software overhead control of signal Quickly resolve complex software overhead control flow Conditional jumps Bit test instructions Efficient program flow – quick, small code Fast response to external events External interrupts Multiple interrupt levels Interrupt priority control Program control immediately redirected on event occurrence; minimal overhead Measurement of sensor data Analog-to-Digital Converters Hardware support for external sensors

13 Microcontroller Peripherals – What’s Important
System Requirement Peripheral What’s Important I/O Control I/O Pins with bit level control Electro-Static Discharge (ESD) rating, Current sink/source Serial Peripheral Communications Serial ports: SPI, I2C, UART, CAN, Ethernet, USB Are there RAM Buffers? Can it handle your flow of data? Enough DMA channels? Precision control of actuators and motors Sophisticated timers and PWM modules Interrupt configuration Intelligent timers Quickly resolve complex software overhead control flow Conditional jumps Bit test instructions Native bit manipulation? Additional instructions to set up? Fast response to external events External interrupts Multiple interrupt levels Interrupt priority control Interrupt overhead? Shadow registers? Programmable priority? Measurement of sensor data Analog-to-Digital Converters How fast is the A/D conversion? What is the accuracy ±LSB?

14 Pulse Width Modulation (PWM)
Used to generate regular external waveforms Not the same as capture/compare timers 16-bit timers with a 16-bit core have lower software overhead than an 8-bit Look for 16-bit microcontrollers that have PWM modules that require no software overhead to generate signals Timer 1 Timer 2 Timer 3

15 16-bit Microcontroller Using ADC, I/O, Timers in a System
Ex: Motor control system A/D feeds back current draw information 16-bit ADC reads in one cycle I/O pins feed back position detection information from encoder 16-bit Timers drive phase windings of motor A/D feedback CapCom Timer position detect Microcontroller phase a Timers phase e

16 What are Interrupts? Stops the execution of present software
Redirects the program flow based on an event Two interrupt sources External Internal Main loop executes code Interrupt occurs State of system is saved on stack Program execution is redirected to an interrupt routine Interrupt routine finishes State of system is restored from stack Code execution resumes at where it left off

17 External Interrupts Tells the program to stop what it’s doing and recognize the interrupt Typically an interrupt is generated on either a rising edge OR falling edge But, some micros can generate an interrupt on any state change Rising OR falling edge Interrupts

18 Choosing a 16-bit Microcontroller Importance of Interrupts
There is overhead, in clock cycles, in saving the state of the system on the stack There is overhead, in clock cycles, in restoring the state of the system on the stack This overhead is hard-wired into the microcontroller. It is non-negotiable For some 16-bit microcontrollers this overhead can be as low as 6 cycles or as long as 20 cycles. All system functions of the microcontroller are locked and unavailable during this time Sure, you can always increase the clock speed Now you’re drawing more power If interrupt latency and power draw isn’t important, you might as well look at a 32-bit

19 Common Features in a 16-bit Microcontroller
More communications stacks so a larger RAM-to-Flash ratio than 8-bit Need performance around 16 to 70MIPS Faster peripherals than an 8-bit Common applications: Motor control User interface Graphic display Human interface Digital power control Switching power supplies RTOS rarely used in 16-bit

20 Next: System Considerations
The End Part 4 Next: System Considerations


Download ppt "Choosing a Microcontroller Architecture"

Similar presentations


Ads by Google