designing with components wilmer arellano. how to chose a microcontroller choose one that you are...
TRANSCRIPT
Designing with Components
Wilmer Arellano
How to chose a Microcontroller
Choose one that you are familiar with or that is easy to learn
How to chose a Microcontroller
When possible select a self contained board that can be used as a learning lab
http://www.mikroe.com/
Different MCU Sockets
Configurability
Power Supply
Programmer
Main Features dsP4011
High-Performance, Modified RISC CPU: Modified Harvard architecture C compiler optimized instruction set architecture with flexible addressing
modes 83 base instructions 24-bit wide instructions, 16-bit wide data path 48 Kbytes on-chip Flash program space (16K instruction words) 2 Kbytes of on-chip data RAM 1 Kbyte of nonvolatile data EEPROM Up to 30 MIPS operation:
• DC to 40 MHz external clock input• 4 MHz-10 MHz oscillator input with PLL active (4x, 8x, 1 6x)
30 interrupt sources:• 3 external interrupt sources• 8 user-selectable priority levels for each interrupt source• 4 processor trap sources
16 x 16-bit working register array
http://www.ee.nmt.edu/~rison/ee308_spr99/supp/990119/harvard.gif
Harvard Architecture
How to chose a Microcontroller
Make a pin count per peripheral required ADC, UARTS, etc
Pinout and Family Differences
How to chose a Microcontroller
Additional boards and accessories available may help
1. Power-on Reset (POR), Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)
2. Brown-out Reset (BOR): A momentary dip in the power supply to
the device has been detected which may result malfunction.
3. The Controller Area Network (CAN) module is a serial interface, useful for communicating with other CAN modules or digital signal controller devices.
4. The 10-bit, high-speed Analog-to-Digital Converter (ADC) allows conversion of an analog input signal to a 10-bit digital number.
5. Input capture is useful for such modes as: Frequency/Period/Pulse Measurements
6. Output Compare is useful in applications requiring operational modes, such as: Generation of Variable Width Output
Pulses Power Factor Correction
7. The Inter-Integrated Circuit module provides complete hardware support for both Slave and Multi- Master modes of the 120 serial communication standard with a 16-bit interface.
CI 2
ARITHMETICS
Program Memory
Data Memory With two address generators
Input/Output Ports
Peripherals
Program Counter
8. The Serial Peripheral Interface (SPI) module is a synchronous serial interface. It is useful for communicating with other peripheral devices, such as EEPROMs, shift registers, display drivers and A/D converters, or other microcontrollers.
9. Timers 5x16 bit timers10. The QEI module provides the
interface to incremental encoders for obtaining mechanical position data.
11. PWM. This module simplifies the task of generating multiple, synchronized Pulse-Width Modulated (PWM) outputs. In particular, the following power and motion control applications are supported by the PWM module:
12. UART. UNIVERSAL ASYNCHRONOUS RECEIVER TRANSMITTER: Full-Duplex, 8 or 9-bit Data
Communication13. PSV Program Space Visibility
Program Memory
Data Memory With two address generators
Input/Output Ports
Peripherals
Program Counter
ARITHMETICS
How to chose a Microcontroller
Select one where many libraries are available
How to chose a Microcontroller
Make sure that good online documentation is available
http://www.mikroe.com/en/books/http://arduino.cc/en/Tutorial/HomePage
How to chose a Microcontroller
If you are new to this type of components and the project allows:Start with a simple microcontroller
Traffic Light Control
Int ledRed = 13; int ledGreen = 11;int ledYellow = 12;
void setup(){ pinMode(ledRed, OUTPUT); // sets the digital pin as output pinMode(ledYellow, OUTPUT); // sets the digital pin as output pinMode(ledGreen, OUTPUT); // sets the digital pin as output}
void loop(){ digitalWrite(ledGreen, HIGH); // sets the Green LED on delay(1000); // waits for a second digitalWrite(ledGreen, LOW); // sets the Green LED off digitalWrite(ledYellow,HIGH); // sets the Yellow LED on delay(1000); // waits for a second digitalWrite(ledYellow, LOW); // sets the Yellow LED off digitalWrite(ledRed, HIGH); // sets the Red LED on delay(1000); // waits for a second digitalWrite(ledRed, LOW); // sets the Reed LED off}
Arduino USB Board
Arduino USB Board
Arduino USB Board
Arduino Ethernet Shield
Example #include <Ethernet.h>
// network configuration. gateway and subnet are optional. byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; byte ip[] = { 10, 0, 0, 177 }; byte gateway[] = { 10, 0, 0, 1 }; byte subnet[] = { 255, 255, 0, 0 }; // telnet defaults to port 23 Server server = Server(23);
void setup() { // initialize the ethernet device Ethernet.begin(mac, ip, gateway, subnet); // start listening for clients server.begin(); }
void loop() { Client client = server.available(); if (client) { server.write(client.read()); } }
Arduino Mega
ATmega64O/1 280/1281/2560/2561
ATmega64O/1 280/1281/2560/2561
How to chose a Microcontroller
Make sure you can meet the throughputOne line of C code can transform into many lines of
assembly
If necessary take one step further
ColdFire
V1 ColdFire® Core brings 8-bit ease of use to 32-bit performance V2 ColdFire Core
ColdFire
V3 ColdFire Core: Single-Issue + Pipelined LocalRefined instruction prefetch pipelineBranch prediction capabilitiesHigher frequencies of operation
V4e ColdFire Core: Limited Superscalar High performance IP Core for the 68K/ColdFire family Partial superscalar execution Harvard memory architecture resulting in enhanced bandwidth Support for variable sized instruction caches and data caches Minimal change-of-flow program execution time via sophisticated 2 level
branch acceleration Virtual memory management unit (MMU)
2 Steps Forward
16 Channel PWM.
http://www.adafruit.com/blog/2012/12/11/player-piano-plays-wikipedia-modifications-uses-adafruit-16-channel-12-bit-pwmservo-driver-raspberrypi-raspberry_pi/
3 Steps Forward
Summary
1. Choose one that you are familiar with or that is easy to learn2. When possible select a self contained board that can be used as
a learning lab3. Make a pin count per peripheral required ADC, UARTS, etc4. Additional boards and accessories available may help5. Select one where many libraries are available6. If you are new to this type of components and the project allows:
Start with a simple one7. Make sure you can meet the throughput
One line of C code can transform into many lines of assembly8. If necessary take 1, 2, or 3 steps further