01 EP Embedded System Basic Introduction

download 01 EP Embedded System Basic Introduction

of 12

Transcript of 01 EP Embedded System Basic Introduction

  • 7/30/2019 01 EP Embedded System Basic Introduction

    1/12

    Embedded System Basic

    Introduction

  • 7/30/2019 01 EP Embedded System Basic Introduction

    2/12

    What is Embedded Programming (EP)?

    term for the computer programming that uses stand alonemicro-controllers (MCU) as the target to run the program.MCU operates in many computer-controlled, i.e. home

    Common Questions in EmbeddedSystem/Microcontroller Subject

    , , , .

    EP is very different from desktop or mainframe programming,embedded programs make piece of hardware/systembecoming intelligent, performing certain action which doesntnot require human intervention.

  • 7/30/2019 01 EP Embedded System Basic Introduction

    3/12

    What is an Embedded System?

    Theres no perfect answer, for our purposes, let define anembedded system is one that uses one or moremicrocomputers, running custom programs and connected tos ecialized hardware to erform a dedicated set of functions.

    Common Questions in EmbeddedSystem/Microcontroller Subject

    Some examples of embedded systems are the Alarm / securitysystem, Car cruise control, ABS, Vending machine, Irrigationsystem etc.

    Embedded Control System

    Control(Analog)

    Sense(Sensors)

    Process(MCU, MPU)

    Software

  • 7/30/2019 01 EP Embedded System Basic Introduction

    4/12

    What is different about Embedded Programming (EP) ?

    EP must work closely with the specialized components andcustom circuitry that makes up the hardware.

    Includes both hardware of the CPU and all the peripherals

    Common Questions in EmbeddedSystem/Microcontroller Subject

    o on-c p an o -c p o e sys em. Compare to PC programming, most embedded systems are

    quite limited in resource, program memory (Flash) and datamemory (RAM) sizes much less compare to the

    Gbytes/Mbytes in the desktop. The processors core usedwill often be smaller 8,16 and 32bit devices as opposed tothe 64 bit and larger devices found in a desktop.

  • 7/30/2019 01 EP Embedded System Basic Introduction

    5/12

    What is the difference between microprocessor and

    microcontroller? A microprocessor processes data. Its a single-chip central

    processing unit (CPU), being the "brains" of a computer. Acomputer is built around a microprocessor, along with

    Common Questions in EmbeddedSystem/Microcontroller Subject

    program an ata memory, an ev ces an ot erperipherals as needed.

    A microcontroller (C ) controls the operation of a machine(e.g. with a program). Its a single chip device which has on

    board not only a microprocessor but also, on the same chip,nonvolatile program (Flash/EEROM/EPROM/ROM) andvolatile data (RAM) memories, along with useful peripheralssuch as general-purpose I/O (GPIO), timers and serial

    communications channels.

  • 7/30/2019 01 EP Embedded System Basic Introduction

    6/12

    Microprocessor (MPU):

    CPU(s) that connect to external memory and

    peripherals. The CPU contains the basic

    arithmetic, logic, and control elements of a

    computer that are required for processing

    data.

    uController Vs uProcessor

    e.g., Intel 8008, 8080, 8086, 80286, Pentium,etc.

    Microcontroller (MCU):

    CPU core with memories, I/O and peripherals

    integrated in a single-chip system, used for

    control application.

    e.g., Intel 8048, 8051, Freescale

    HC08,S08,S12,HC11, HC16 and etc.

  • 7/30/2019 01 EP Embedded System Basic Introduction

    7/12

    What is an N-bit CPU/microprocessor/microcontroller?

    If the device can perform most of its data manipulationinstructions on data words to a maximum of N bits in size, thedevice is an N-bit processor.

    Common Questions in EmbeddedSystem/Microcontroller Subject

    - m crocon ro ers are e gges segmen o eembedded market. Many applications simply dont need any

    more power, and never will. 16-bit devices are morepowerful, but they are squeezed between the 8-bit devices onthe low end and the 32-bit devices on the high end. 32-bitdevices are at the high end of the embedded spectrum forcomplex or high-performance designs.

  • 7/30/2019 01 EP Embedded System Basic Introduction

    8/12

    Microcontroller Bit Definition

    4,8,16,32 are current options. Bus A bus is a data pathway betweenseveral hardware components inside oroutside a computer. It not only connects

    ,

    also links the CPU with other importanthardware. The capacity of a bus isexpressed as bits. A larger capacity busis faster in data transfer. For example, a32-bit bus is faster than an 8-bit bus

    ADDRESS: tells which module (RAM, ROM, IO) interacts with the CPU.DATA: information to be transferred from/to processor to/from other devices.CONTROL: specifies direction (read, write) and when transfer takes place.

  • 7/30/2019 01 EP Embedded System Basic Introduction

    9/12

    How does an embedded program run?

    Assumption: program is loaded it into the C program memory. The run starts when you either turn on the device or you push the

    RESET button.

    Common Questions in EmbeddedSystem/Microcontroller Subject

    memory location (defined by the manufacturer), to beginexecuting whatever code is found there. The fixed memorylocation is a vector, a location that holds the actual address of thebeginning of the program, e.g. upon coming out of reset, the

    controller will load its program counter with the value found atprogram address 0xFFFE.

    One need to ensure the specified startup address is loaded into thereset address vector.

  • 7/30/2019 01 EP Embedded System Basic Introduction

    10/12

    How does an embedded program run? (cont)

    When an embedded program starts to run, there is usually a fair amount ofinitialization that must be done before the main program begins. (In desktopcomputers this is handled by the computer boot code and operating system).

    No OS, and all boot code and other startup code must be explicitly provided.

    Common Questions in EmbeddedSystem/Microcontroller Subject

    ome very cr ca ar ware may nee o e n a ze rs e.g. ar ware acontrols memory access times and address maps, as well as system clockhardware.

    Then some software initialization may need to happen, such as setting up a

    stack pointer and perhaps copying data from nonvolatile memory to volatilememory where it can be accessed and perhaps modified. After that willusually come another round of hardware initialization, setting up anyperipheral devices that the system requires (i.e. speed, communication config,and setting initial output states )

  • 7/30/2019 01 EP Embedded System Basic Introduction

    11/12

    Where are Microcontroller?

    11

    PC peripherals hospital beds electricwheel chairs lighting control systems environmental and buildingautomation access control panels laboratory equipment

    Stationary barcode scanners andbarcode printers patient monitoringsystems security systems building& HVAC controls industrial networkingproducts

  • 7/30/2019 01 EP Embedded System Basic Introduction

    12/12

    IICMEM

    IIC

    ADC

    Pot orAccel Sensor

    USB

    Typical Applications

    BLDCAdaptBoard

    SPI

    SCI

    Segment LCD

    GPIO InputsGPIO LED Outputs

    PWM

    Dim LEDTPM

    S08MCU

    RS232RS485

    Zigbee

    Buzzer

    ADC InputChannels

    External EventInput Channels