designing with components wilmer arellano. how to chose a microcontroller choose one that you are...

41
Designing with Components Wilmer Arellano

Upload: joshua-jennings

Post on 03-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Designing with Components

Wilmer Arellano

Page 2: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn
Page 3: 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

Choose one that you are familiar with or that is easy to learn

Page 4: 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

Page 5: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

http://www.mikroe.com/

Page 6: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Different MCU Sockets

Page 7: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Configurability

Page 8: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Power Supply

Page 9: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Programmer

Page 10: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

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

Page 11: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

http://www.ee.nmt.edu/~rison/ee308_spr99/supp/990119/harvard.gif

Harvard Architecture

Page 12: 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

Make a pin count per peripheral required ADC, UARTS, etc

Page 13: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Pinout and Family Differences

Page 14: 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

Additional boards and accessories available may help

Page 15: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn
Page 16: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

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

Page 17: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

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

Page 18: 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

Select one where many libraries are available

Page 19: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn
Page 20: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn
Page 21: 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

Make sure that good online documentation is available

http://www.mikroe.com/en/books/http://arduino.cc/en/Tutorial/HomePage

Page 22: 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

If you are new to this type of components and the project allows:Start with a simple microcontroller

Page 23: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn
Page 24: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

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}

Page 25: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Arduino USB Board

Page 26: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Arduino USB Board

Page 27: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Arduino USB Board

Page 28: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Arduino Ethernet Shield

Page 29: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn
Page 30: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

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()); } }

Page 31: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

Arduino Mega

Page 32: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

ATmega64O/1 280/1281/2560/2561

Page 33: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

ATmega64O/1 280/1281/2560/2561

Page 34: 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

Make sure you can meet the throughputOne line of C code can transform into many lines of

assembly

If necessary take one step further

Page 35: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

ColdFire

V1 ColdFire® Core brings 8-bit ease of use to 32-bit performance V2 ColdFire Core

Page 36: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn
Page 37: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

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)

Page 38: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

2 Steps Forward

Page 39: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

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/

Page 40: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

3 Steps Forward

Page 41: Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn

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