programming error in PIC16F84A

Discussion in 'Homework Help' started by ranasinghe.um, Nov 18, 2010.

  1. ranasinghe.um

    Thread Starter New Member

    Nov 18, 2010
    3
    0
    I wrote the following cording in MPLAB and created the .HEX file.
    and i used PICprog4u to program the IC.

    ;*****Set up the Constants*****

    STATUS equ 03h
    TRISA equ 85h
    PORTA equ 05h
    CounterL equ 0Dh
    CounterH equ 0Eh

    ;*****Set up the port*****

    bsf STATUS,5
    bcf TRISA,0
    bcf STATUS,5

    ;*****Turn the LED on*****

    Start bsf PORTA,0

    ;*****Delay loop1*****

    Loop1 decfsz CounterL,1
    goto Loop1
    decfsz CounterH,1
    goto Loop1

    ;*****Turn the LED OFF*****

    bcf PORTA,0

    ;*****Delay loop2*****

    Loop2 decfsz CounterL,1
    goto Loop2
    decfsz CounterH,1
    goto Loop2
    goto Start
    end

    but when i open this .HEX file in the above PIC programming software it gives the warning " configuration word was not in the HEX file ! "
    and the PIC doesn't work.

    please help me to come up with this problem, because I'm new to this field..

    THANK YOU !!
     
  2. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    When Mplab assembled the code and created the hex file, it didnt created the configuration settings as you didnt wrote them.You can do two things write the config settings for the mcu you are using in the code file as directive or in the programmer software set the config bits.

    What is config?
    The settings for Hardware like which type of Oscillator you will use,is watchdog turned off or on and many more.. in the mplab's help file you will find many thing more or you can also try google ,for a small example

    Code ( (Unknown Language)):
    1. #include p16f877a.inc   ;include file with config bit definitions__config _HS_OSC & _WDT_OFF & _LVP_OFF  ;Set oscillator to HS,                                        ;watchdog time off,                                        ;low-voltage prog. off
    Here I am using PIC16F877 and I want high speed osc like 8Mhz ceramic resonator,turn off the watch dog timer and low voltage programming. Good Luck
     
    ranasinghe.um likes this.
Loading...