Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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
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..???
 

ernpao

Advanced Member level 4
Joined
Sep 16, 2010
Messages
100
Helped
26
Reputation
52
Reaction score
24
Trophy points
1,298
Activity points
2,043
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.
 

paulfjujo

Advanced Member level 4
Joined
Jun 9, 2008
Messages
1,428
Helped
290
Reputation
580
Reaction score
275
Trophy points
1,363
Location
France 01800
Activity points
10,024
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
 

jsbhalla88

Member level 1
Joined
Mar 3, 2015
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
314
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.
 

ernpao

Advanced Member level 4
Joined
Sep 16, 2010
Messages
100
Helped
26
Reputation
52
Reaction score
24
Trophy points
1,298
Activity points
2,043
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.
 

jsbhalla88

Member level 1
Joined
Mar 3, 2015
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
314
i corrected it ..calculating checksum, and changing it..it works fine..its calculation mistake...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top