Please help me to come up with this..

Thread Starter

ranasinghe.um

Joined Nov 18, 2010
3
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
end


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:
 

t06afre

Joined May 11, 2009
5,934
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.
S
Example​
#include p16f877a.inc ;include file with config bit definitions
__config _HS_OSC & _WDT_OFF & _LVP_OFF ;Set oscillator to HS,​
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
 
Top