[SOLVED] PIC16F16xx loading HEX file gives error

Status
Not open for further replies.

jsbhalla88

Member level 1
Joined
Mar 3, 2015
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Visit site
Activity points
314
Hi
I am using PIC16f1618 with MikroC PRO for PIC. to load the HEX file into PIC, I am using PICKIT3 with MPLAB IPE ver.2.35.
when I load the HEX file, it gives the following error:

The line checksum on line 6 of the hex file is incorrect; the hex file appears to have been corrupted.

:06000E00E23E871F1F3F26"Loaded hex file is invalid.

I am just using a blank code(empty "main()" function).

also, if the file is loaded into MPLAB IPE, I am not able to rebuild the project. it says, says "the file is already open" and gives an error, does not build. I never had this issue before.

I can load the pic16 template from MPLABX IDE to controller. so, the protype board is good.
I have tried with PIC16F16xx controllers, they all give the same error...

can anyone suggest..???
 

Maybe it is because your main() function is empty? Try writing anything. Haven't tried loading a hex file with an empty main function before though. As you say, it might work with mplabx but mikroc is a different compiler/ide so it builds things differently from mplabx.

I also build projects with mikroc + pickit3 and i find using the old mplab 8 to be easier to use for just loading hex files alongside mikroc compared to mplab ipe. When I rebuild my project in mikroc, mplab 8 automatically loads the new hex file and i can save workspaces in mplab 8. Makes it easier to switch projects with different mcu families.
 

I also use a stand alone Pickit3 programme with MikroC Hex ..
but PIC16F1618 is not in the piclist ..
maybe too old pickit3 version
or 16F1618 not supported by Pickit3
 

ernpao:
it works with blank main() function.., I have tried that with PIC18F45K22.
so it should work with pic16f too..
well, I tried writing simple delay in main, it builds, but again gives the same error...

- - - Updated - - -

I also use a stand alone Pickit3 programme with MikroC Hex ..
but PIC16F1618 is not in the piclist ..
maybe too old pickit3 version
or 16F1618 not supported by Pickit3
pic16f1618 is there in the device list..it connects successfully.
 

Well, it may be related to mikroc, as it seems to be generating incorrect hex files for the 16f16xx. And as you say, everything works fine in mplabx and the ipe. Not really familiar with them, but are they new mcus from microchip? Try to look around on google if any one has had success using 16f16xx with mikroc.
 

i corrected it ..calculating checksum, and changing it..it works fine..its calculation mistake...
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…