PIC Microcontroller Chapter 02 1

Embed Size (px)

Citation preview

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    1/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    2/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    3/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    4/36

    Reduced instruction set architecture Has ONc ip program co e ROM, ata

    RAM,timers,ADC , USART and I/O ports ROM : 128 k to2MB OTP t es : One t e ro rammable chea

    solution )

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    5/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    6/36

    Block Diagram

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    7/36

    Require UVEPROM burner Ta es ~20 minutes Thus Flash version is introduced The letter F in the series name like

    is used in this IC

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    8/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    9/36

    debugging phase , microchip can create

    hex file burnt.

    The letter C means the OTP version like

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    10/36

    PIC microcontroller and the embedded

    By Danny Causey and Muhammad Al Mazidi

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    11/36

    , But support for the PIC is much stronger for

    Builtin C libraries are there RTOS, USART , CAN Bus inter aces an t e USB et ernetinterfaces which cut short the design cycle

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    12/36

    arithmetic and logic operations

    Used to store temporary information , data , va ues resu ts .etc. MOVLW ; move literal value K into WREG MOV LW 25H ; moves 25 to W

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    13/36

    WREG

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    14/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    15/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    16/36

    MPLAB ( by microchip)

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    17/36

    Its documentation is uploaded on group

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    18/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    19/36

    Software for programming is uploaded in

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    20/36

    Converted to hex

    programmer (while programming, the LCD, MAX232 IC and the USB connection should be unconnected)

    After ro rammin the serial cable should be disconnected and the USB power cable mounted for checking the code

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    21/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    22/36

    interfaces e.g. Serial communication I/O ports

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    23/36

    that are used for data storage and scratch pad

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    24/36

    WREG register

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    25/36

    MOVLW 25H; load25h in wreg ADDLW 34H; a va ue 34to W W=W+34

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    26/36

    8086

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    27/36

    RP1:RP0 . Bank select PD Power down bit (0 sleep .. Power save . 1 : power

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    28/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    29/36

    Values at addresses after execution of instructions

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    30/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    31/36

    register location.

    ADDWF filereg ,

    D

    Where filereg is the register destination and D is the bit

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    32/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    33/36

    PIC16 Instruction set summary continued

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    34/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    35/36

  • 8/2/2019 PIC Microcontroller Chapter 02 1

    36/36