01 Concepts and Fundamentals

Embed Size (px)

Citation preview

  • 7/27/2019 01 Concepts and Fundamentals

    1/18

    Microcontrollers

    Concepts and Fundamentals

  • 7/27/2019 01 Concepts and Fundamentals

    2/18

    Microcontrollers 2

    Objectives

    To know and understand the concepts andfundamentals related to the study of microcontrollers

  • 7/27/2019 01 Concepts and Fundamentals

    3/18

    Microcontrollers 3

    Contents

    Review of a microcomputer system

    Central processing unit, CPU

    CPU cycles

    Definition of buses PIC microcontroller architecture

  • 7/27/2019 01 Concepts and Fundamentals

    4/18

    Microcontrollers 4

    A Typical Microcomputer System

  • 7/27/2019 01 Concepts and Fundamentals

    5/18

    Microcontrollers 5

    A Typical Microcomputer System

    The operation of the whole system is under control of aCentral Processing Unit (CPU)

    There is support for bidirectional human interface (I/O)

    I/O ports for interaction with the outside world(peripheral)

    Primary memory for program and data

    Secondary memory for mass storage and data backup

    Auxiliary memory for graphics processing

  • 7/27/2019 01 Concepts and Fundamentals

    6/18

    Microcontrollers 6

    Central Processing Unit (CPU)

    IR

    INSTRUCTION

    DECODER

    ALU

    PROGRAM

    +

    PC

    R0-R15

    17

    OEN

    8

    WRITE

    LD_IR

    LD_IR_LSN

    SEL_DATA_RAM1

    JUMP_PC INC_PC

    C

    Z

    ACC

    AOP

    1111111111111

    0000000000

    CEN

    WEN

    4

    4

    4

    4

    7

    7

    8

    4

    7

    7

  • 7/27/2019 01 Concepts and Fundamentals

    7/18Microcontrollers 7

    CPU Cycles

    The operation of a typical CPU can be decomposed intothree main cycles: fetch, decode and execute

    The fetch cycle consists in getting an instruction from

    the instruction memory and storing it in the instructionregister

    The decode cycle consists in translating the bit pattern

    of the instruction into control signals (instruction

    decoder) The execute cycle consists in inputting data to the ALU,

    selection an ALU operation and storing the result in

    either an internal register or the data memory

  • 7/27/2019 01 Concepts and Fundamentals

    8/18Microcontrollers 8

    Buses

    Three buses can be found in a microcomputer system:data, control and address bus

    The data bus is the communication channel between the CPU

    and the rest of the system

    The address bus allows the selection of the

    source/destination of the data

    The control bus determines the type of communication that

    takes place, i.e. reading or writing access

  • 7/27/2019 01 Concepts and Fundamentals

    9/18Microcontrollers 9

    Buses

    A schematic diagram indicating the communication ofthe three buses with the CPU is shown below

  • 7/27/2019 01 Concepts and Fundamentals

    10/18Microcontrollers 10

    Microprocessors vs. Microcontrollers

    Microcontroller-based systems are microcomputersystem built around a microprocessor (CPU) and a set

    of memories and peripherals, all encapsulated in an

    integrated circuit (IC)

  • 7/27/2019 01 Concepts and Fundamentals

    11/18

    Microcontrollers 11

    Microprocessors vs. Microcontrollers

    Regarding applications Microprocessors are used in data-processing applications

    Microcontrollers are used as reactive systems that deal with

    events from the outside world and as control systems with I/O

    interfacing

    Regarding the instruction set

    Microprocessors support complex addressing modes that are

    aimed to handling several structures of data: arrays, pointers,

    etc.

    Microcontrollers are aimed to controlling and monitoring I/O

    ports in terms of verification of status bits, interrupts and

    timers

  • 7/27/2019 01 Concepts and Fundamentals

    12/18

  • 7/27/2019 01 Concepts and Fundamentals

    13/18

    Microcontrollers 13

    Von Neumann Architecture

    A single integrated circuit memory that holds data andprogram

    The CPU is in charge of identifying data from program

    Same bits width for data and instructions

    CPUCPU

    DATADATA

    andand

    PROGRAMPROGRAM

    MEMORYMEMORY

  • 7/27/2019 01 Concepts and Fundamentals

    14/18

    Microcontrollers 14

    Harvard Architecture

    Data and program have their own memory

    The bit widths may differ

    Simultaneous access are allowed

    CPUCPUDATADATA

    MEMORYMEMORY

    (RAM)(RAM)

    PROGRAMPROGRAM

    MEMORYMEMORY

    (ROM)(ROM)

  • 7/27/2019 01 Concepts and Fundamentals

    15/18

    Microcontrollers 15

    Pipeline Processing

    The internal architecture is divided into independentblocks that are serially connected forming a pipeline

    The execution of an instruction is allocated to a certain

    number of blocks Execution of several instructions can be simultaneously

    executed in an one-after-the-other fashion

    BLOCKBLOCK

    11

    BLOCKBLOCK

    22

    BLOCKBLOCK

    33

    BLOCKBLOCK

    44

  • 7/27/2019 01 Concepts and Fundamentals

    16/18

    Microcontrollers 16

    RISC, CISC ans SISC Processors

    CISC (Complex Instruction Set Computer) Large number of instructions

    Complex and powerful instructions

    RISC (Reduced Instruction Set Computer) Reduced number of instructions

    Simple instructions ans easy coding

    SISC (Specific Instruction Set Computer)

    Reduced number of instructions

    Application-oriented instructions

  • 7/27/2019 01 Concepts and Fundamentals

    17/18

    Microcontrollers 17

    Orthogonal Architecture

    In a traditional architecture, the outcome of an ALUoperation can only be stored in the accumulator

    In an orthogonal architecture, the outcome of an ALU

    operation can be stored in an internal register as well asthe accumulator

    ALUALU

    DATADATA

    MEMORYMEMORY

    ACCACC

    ALUALU

    DATADATA

    MEMORYMEMORYWW

    Traditional

    Orthogonal

  • 7/27/2019 01 Concepts and Fundamentals

    18/18

    Microcontrollers 18

    Summary

    Microcontrollers are microcomputer systems made up ofa CPU, memories and peripherals presented as an IC

    The execution of instructions by the CPU has three

    phases: fetch, decode and execute Microchips PIC have a harvard, RISC and orthogonal

    architecture

    The microcontrollers that will be studied are 8-bit data

    wide