tema4 sistemas digitales microprocesador

Upload: marco-cuevas-gomez

Post on 04-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    1/24

    Microprocessor-based Digital Systems 1

    Seminarios-Taller de Informtica Hardware

    Microprocessor-based Digital Systems

    Grado en Ingeniera Informtica

    Primer Curso

    Microprocessor-based Digital Systems 2

    Agenda

    1. Microprocessor-based Embedded Systems

    2. Microcontrollers

    3. Skybot Robot

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    2/24

    Microprocessor-basedEmbedded Systems

    Microprocessor-based Digital Systems 3

    Microprocessor-based Digital Systems 4

    Computers

    When you hear the word computer, you always think

    of a desktop computer:

    But we are surrounded by thousands of invisible

    computers, embedded in complex devices

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    3/24

    Microprocessor-based Digital Systems 5

    Embedded Computers

    Every electronic or electromechanical system has a

    computer (or many) embedded in it:

    Microprocessor-based Digital Systems 6

    So What Is an Embedded System?

    An embedded system is a special-purpose computer

    system built into a larger device

    Embedded systems are required to meet very different

    requirements than a general-purpose personal computer

    Two distinguishing characteristics:

    Cost: Since embedded systems are produced in the tens of

    thousands to millions of units range, reducing cost is a major

    concern. Embedded systems often use a (relatively) slow

    processor and small memory size to minimize costs

    Space and Power consumption: Usually embedded systems

    have tight space limitations, so they must be built out of a

    few components (this also benefits the cost) and complex

    power dissipation mechanisms (like fans) are not allowed

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    4/24

    Microprocessor-based Digital Systems 7

    What Is an Embedded System?

    Software Issues

    The third feature of a embedded system is that it is

    single-functioned, not general-purpose like a desktop The SW run in the embedded systems is called Firmware

    It is stored in non-volatile memory (Flash, ROM)

    At most they have a simple operating system, but in

    most cases the have no OS at all

    A embedded system is a real time computer

    Continually react to changes in the systems environment

    Reliability is a must In most embedded systems a software crash is simply not

    allowed, e.g. ABS brake system or DVD player

    Microprocessor-based Digital Systems 8

    A Little History

    One of the first embedded systems was the Apollo

    Guidance Computer, started in 1962:

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    5/24

    Microprocessor-based Digital Systems 9

    The Apollo Guidance Computer

    Developed by the Charles S.

    Draper team at the MIT

    The first computer built using

    ICs (4100 3-input NORs

    connected by wire-wrapping)

    4K RAM (ferrite core)

    32K ROM (core rope mem)

    11 instructions

    16 registers

    5 vectored interrupts

    Programmed in assembler, ithad a non-preemptive multi-

    tasking OS (up to 8 jobs)

    Microprocessor-based Digital Systems 10

    Embedded Systems Today

    James Benefer, Designing an optimal wireless SoC, EET October 11th 2004

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    6/24

    Microprocessor-based Digital Systems 11

    Embedded Systems Today (2)

    Most of the components are integrated in one chip

    System on a chip, SoC, with millions of transitors Can integrate analog and RF sections, and flash memories.

    Only SDRAM, some passive components and power supply

    are needed.

    Multiprocessing:

    A general purpose processor together with a DSP, and also

    there might be custom co-processors (e.g. MPEG-4)

    Plenty of peripherals:

    General-purpose (Timers, INTC, UART) as well as specific

    ones (HDD, Memory Card, Wireless, USB)

    Platform-based design

    Microprocessor-based Digital Systems 12

    Embedded Systems Are Everywhere

    The average middle-class

    American household has about

    40 to 50 microprocessors in it

    Another 10 microprocessors are

    in every PC

    The Mercedes S-class has 65

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    7/24

    Microprocessor-based Digital Systems 13

    Some Examples: Bluetooth

    Bluetooth RF System-on-Chip: Product Design Challenges and Tradeoffs

    Andreas Sibrai and Vjekoslav Matic, TechOnLine Jan. 28, 2004

    Microprocessor-based Digital Systems 14

    Some Examples: DVD Writer

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    8/24

    Microprocessor-based Digital Systems 15

    But Do Things Have

    to Be that Complex?

    Microprocessor-based Digital Systems 16

    No! Still a Lot of Problems Can Be

    Solved with 8-Bit Microprocessors

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    9/24

    Microprocessor-based Digital Systems 17

    Most Embedded Systems Are Simple

    Intel just holds a 2% of the global processor market

    Currently there are 40 MCU vendors, 1300 different 8-bitdevices and 240 32-bit alternatives

    Plenty of problems are solved with a simple 8-bitmicrocontroller: Successful PIC and Motorola HC08 families

    Low-cost and low-power, and have SoC features (a lot ofperipherals, analog sections)

    Known devices, no need for learning new design flows

    The best solution is not the most complex, is the onethat optimizes the tradeoff between all the differentdesign metrics

    Microprocessor-based Digital Systems 18

    Design Metrics

    Cost

    Unit cost: The cost of manufacturing each unit (just the

    component and assembly costs)

    NRE (Non-Recurring Engineering Cost): The one-time cost

    of designing the system (includes prototyping)

    Performance

    Most important: Ability to work in real time

    Time to give a response to the user (e.g. navigation system)

    Physical Constraints

    Size

    Power

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    10/24

    Microprocessor-based Digital Systems 19

    Design Metrics (2)

    Development time

    Time-to-protoype: The time needed to build a first workingversion of the system

    Time-to-market: The latter time, plus the time to manufacture

    the product and distribute it to the resellers

    Other design issues

    Flexibility: the system can be used for different tasks without

    significantly increasing the NRE or the unit costs

    Maintainability: the system can easily be updated and/or

    repaired Fail-safe operation: Necessary in mission-critical systems,

    like life support

    Microcontrollers

    Microprocessor-based Digital Systems 20

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    11/24

    Definition

    A microcontroller is an integrated circuit or chip that

    includes the three functional units of a computer: Central Processing Unit

    Memory

    Input/Output and/or peripherals

    Microprocessor-based Digital Systems 21

    Definition

    Microcontrollers are usually

    designed for specific applications

    Price and power consumption are

    important

    Each application has different needs

    Performance of the Central

    Processing Unit

    Size of memory

    Peripherals

    Microprocessor-based Digital Systems 22

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    12/24

    Microcontroller vs. Microprocessor

    There are several differences,

    but the most important is thefunctionality

    A microprocessor needs

    additional components such as

    memories, peripherals, etc.

    A microcontroller includes all the

    necessary components

    No additional components are

    necessary (usually) All peripherals and additional

    units are included

    Microprocessor-based Digital Systems 23

    Components of a Microcontroller

    Microprocessor-based Digital Systems 24

    Fuente: http://o.mneina.googlepages.com/what_is_microcontroller.htm

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    13/24

    Components of a Microcontroller

    Memory unit Store the program instructions and

    temporal data Program memory is not usually

    bigger than 16 K-words of non-volatile memory

    Data memory, typically SRAM, isnot usually bigger than 5 Kilobytes

    Central processing unit Executes operations with memory

    Executes arithmetic operations

    Includes small high-speed memory

    called registers Store data for arithmetic and

    memory operations

    Microprocessor-based Digital Systems 25

    Components of a Microcontroller

    Buses There are two types of buses: address

    and data Address bus contains the position to

    be read or write Data bus contains the data to be reador write

    Input/Output units Also known as ports

    There are three types of ports: Input

    Output

    Bidirectionals

    Ports are part of the memory They can be read or write

    The value of the port is the value of thepins of the port

    Microprocessor-based Digital Systems 26

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    14/24

    Components of a Microcontroller

    Timer Provides a time reference for

    timing, counting, etc.

    It is basically a counter

    A register which value isincremented each clock cycle

    Take the value before and aftera task to calculate the executiontime of the task

    Very important component

    Communications

    Peripherals to communicate withthe outside world

    Parallel, serial, USB, CAN,Ethernet, etc.

    Microprocessor-based Digital Systems 27

    Components of a Microcontroller

    Watchdog Internal timer

    Helps to detect if

    If the microcontroller is stopped

    The program is not workingcorrectly

    Analog-Digital Converter (ADC) Outside world is usually analogic

    Allows to convert analog signals todigital signals a vice versa

    Microcontroller only operates withdigital values

    Microprocessor-based Digital Systems 28

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    15/24

    Microcontrollers

    Vendors

    Microprocessor-based Digital Systems 29

    Microcontrollers

    Shapes

    Microprocessor-based Digital Systems 30

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    16/24

    Sistema Skybot

    Microprocessor-based Digital Systems 31

    Skybot Descripcin

    Sistema abierto para el desarrollo completo de robots

    Software multiplataforma

    Estructura metacrilato con dos motores de CC Sensores:

    2 sensores de contacto

    Hasta 4 fotodetectores

    1 LDR

    1 Rele

    Electrnica:

    CPU: Skypic (Microcontrolador PIC) Tarjeta de potencia: Sky293 (L293)

    Microprocessor-based Digital Systems 32

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    17/24

    Skybot Descripcin

    Microprocessor-based Digital Systems 33

    Sensores de

    contacto

    Sensores de luz

    Sensores de

    infrarrojos

    Skybot Ejemplos

    Microprocessor-based Digital Systems 34

    Sigue lneas Mogolln

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    18/24

    CPU: Skypic Descripcin

    Tarjeta entrenadora para los PIC16f87X

    Contiene el PIC16f876a

    Compatible con el ICD2 de Microchip

    Led y pulsador de pruebas

    Conexin directa de 8 servos

    Hardware libre y multiplataforma

    Conectores que dan acceso a todos losrecursos del microcontrolador

    Dos sistemas de comunicaciones diferentes

    para su interconexin con otras tarjetas, unPC o cualquier otro sistema Driver serie tipo RS-232

    Bus I2C para conexin de sensores

    Microprocessor-based Digital Systems 35

    PIC 16f876a (pines)

    Microprocessor-based Digital Systems 36

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    19/24

    Microprocessor-based Digital Systems 37

    Microprocessor-based Digital Systems 38

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    20/24

    Microprocessor-based Digital Systems 39

    La Skypic aade a este circuito:

    Conversor TTL->RS232

    LED de pruebas

    Pulsador de pruebas

    Conexin ICD2

    Bus I2C

    Skypic Interfaces

    Microprocessor-based Digital Systems 40

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    21/24

    Potencia: Sky293 Descripcin

    Interfaces para manejar hasta 2 motoresbidireccionales o un motor paso a paso

    bipolares. L293 que contiene 2 Puente-H

    Interfaces para polarizar y controlar lalectura (analgico y/o digital) de hasta 4fotodetectores

    Permite un sistema de alimentacin de losmotores diferente al de la lgica

    Dispone de 6 entradas analgicas(Pueden ser entradas/salidas digitales y

    otras 4 seales de entrada/salida digital).

    Dispone de un rel

    Microprocessor-based Digital Systems 41

    Sky293 Interfaces

    Microprocessor-based Digital Systems 42

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    22/24

    Software

    Microprocessor-based Digital Systems 43

    Para programar el Skybot necesitamos las siguientes

    herramientas:

    SDCC: Compilador de C para microcontroladores PIC GPUTILS: Utilidades para microcontroladores PIC

    Pydownloader: Descarga de programas a la Skypic

    Skybot-test: Programa de diagnsticos para Skybot

    Editor de textos para escribir los programas

    Enlaces recomendados:http://www.iearobotics.com/wiki/index.php?title=Taller_Skybot:Sesi%C3%B3n_3

    http://www.iearobotics.com/wiki/index.php?title=Taller_Skybot:Sesion4:Programaci%C3%B3n_del_Skybot

    http://www.iearobotics.com/wiki/index.php?title=Programaci%C3%B3n_del_PIC16_en_C

    Microprocessor-based Digital Systems 44

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    23/24

    Microprocessor-based Digital Systems 45

    Conexin al PC

    Puerto Serie

    RS232-38400,8n1

    En los laboratorios: COM1

    Programas

    Microprocessor-based Digital Systems 46

    Programmers Notepad: Editor - Compilador

  • 8/13/2019 Tema4 Sistemas Digitales Microprocesador

    24/24

    Programas

    Microprocessor-based Digital Systems 47

    Skybot-test: Prueba del robotPydownloader: Descarga

    Manuales y referencias

    Descripcin del robot Skybot

    http://www.iearobotics.com/wiki/index.php?title=Skybot

    Proceso de montaje del Skybot

    http://www.iearobotics.com/wiki/index.php?title=Taller_Skybot

    Instalacin del softwarehttp://www.iearobotics.com/wiki/index.php?title=Taller_Skybot:Sesi%C3%B3n_3

    Manuales de programacinhttp://www.iearobotics.com/wiki/index.php?title=Taller_Skybot:Sesion4:Programaci%C3%B3n_del_Skybot

    http://www.iearobotics.com/wiki/index.php?title=Programaci%C3%B3n_del_PIC16_en_C

    Manual de la Skypic

    http://www.iearobotics.com/wiki/index.php?title=Skypic

    Manual de la Sky293http://www.iearobotics.com/proyectos/sky293/sky293.html