Please help me to come up with this..

Discussion in 'Programmer's Corner' started by, Nov 19, 2010.


    Thread Starter New Member

    Nov 18, 2010
    I wrote the following cording in MPLAB to get a single output from the 17th pin and created the .HEX file.
    There was no errors in compiling the program.
    I used PIC 16F84A

    ;*****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

    then i used PICProg4U software to write this program in to PIC through JDM programmer.

    When loading the .HEX file it gives a warning "Configuration word was not found in the HEX file"..

    After writing the program to the PIC it fails to verify.
    then it gives a verification error..:confused:
  2. maxpower097

    Well-Known Member

    Feb 20, 2009
    Try setting the configuration bits in mplab in the Config Bits radio button menu.
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    Se the section "special features of the cpu configuration bits" in the data sheet.
    Use the __config directive. This directive is placed in source code so that, when the code is assembled into a hex file, the configuration values are preset to desired values in your application. Place configuration bit assignments at the beginning of your code. Use the configuration options (names) in the standard include (*.inc) file at the end. These names can be bitwise ANDed together using & to declare multiple configuration bits.
    Example ​
    Also then you program it is better to take benefit of the include file. Here every register is defined. Some registers even on bit level
    Also every chip has its own template file in the folder
    Program files\Microchip\MPASM Suite\Template\Code
 likes this.

    Thread Starter New Member

    Nov 18, 2010
    thank you very much sir..i will try it :)