View previous topic :: View next topic |
Author |
Message |
bschriek
Joined: 18 Dec 2007 Posts: 80
|
Checksum not the same |
Posted: Fri Apr 05, 2019 6:50 am |
|
|
IDE 5.080, 12F1572
I like to save the value of the Checksum at the ID locations.
Therefore I add the following command to my program:
#id CHECKSUM
When I start the CCS DEVICE PROGRAMMER and open the "Device" window I'm able to see the Checksum and ID bits.
Checksum shows me 07D5
ID shows me 826D
And when I check the last lines of the .LST file this is the result:
ID Locations: 08 00 02 00 06 00 0D 00
According the manual the Checksum is saved at the ID locations.
But the value of the Checksum (07D5) is different from the ID bits(826D)
What's wrong?
Thank you in advance. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9220 Location: Greensville,Ontario
|
|
Posted: Fri Apr 05, 2019 9:38 am |
|
|
I don't have the CCS device programmer but if IT is calculating the checksum and the CCS compiler does as well, it is possible that they are using different algorithms for the checksum.
I quickly checked the CCS manual and didn't find a 'how-cheksum-is-calculated' reference.
Other who whose this feature daily, may know though.
Jay |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Mon Apr 08, 2019 12:43 am |
|
|
Dear Temtronic,
Thank you for your comment.
I'm sorry, maybe I was not clear about the DEVICE PROGAMMER.
The device programmer (CCSLoad) is part of the CCS C Compiler.
Actually when you start the CCSLoad app you will find the text "CCS DEVICE PROGRAMMER" at the top of the screen.
So at the first page of CCSLoad you will find the value of the Checksum
and the ID bits.
Any help is welcome,
Best regards,
Bas |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9220 Location: Greensville,Ontario
|
|
Posted: Mon Apr 08, 2019 4:37 am |
|
|
I don't use CCSLoad. To program PICs I use MPLAB to access the PICkit3 that actually programs the PIC.
Hopefully someone who uses your method will reply soon.
Jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Apr 08, 2019 11:58 am |
|
|
It doesn't work, but here is a work-around:
Compile your program and load the hex file into CCSLoad.
Look at what CCSLoad says the checkum is. Then stick that
value into the #ID statement in your program. Re-compile.
Now look at CCSLoad. The checksum and the ID are the same.
Yes, it involves a manual step. But presumably this would be
done only for the final production code. So it's only one time.
It solves the problem. |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Tue Apr 09, 2019 1:35 am |
|
|
Thank you, problem solved! |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Tue Apr 09, 2019 5:58 am |
|
|
PCM_p.... how do you know all this stuff? _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Apr 09, 2019 9:04 am |
|
|
That particular one, I found by experimentation just recently. |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Wed Apr 10, 2019 12:52 am |
|
|
From the .Hex file only I can read 0x01EF in user id bits but the checksum calculated by microchip IPE v5.05 is 0x5A96. They are not the same.
What standard or what method is used by CCS to calculate the checksum?
This because if we send our .Hex file and Checksum to another company for programming their Checksum does not agree to our Checksum.
Is the whole Checksum idea not a bit old-fashioned for these small µcontrollers?
If you can help me please, otherwise I will forget the whole Checksum idea.
Thank you in advance, |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Apr 10, 2019 3:03 am |
|
|
I was afraid that you wanted more. You didn't merely want the numbers
to match. You wanted to use the numbers and understand them.
Here is the the 2nd page of a thread from the past. It ends inconclusively.
http://www.ccsinfo.com/forum/viewtopic.php?t=17536&start=15
I don't have the time to research this now. My time is taken up by other
things lately. |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Wed Apr 10, 2019 3:33 am |
|
|
Thanks, just forget the whole Checksum idea......
I think there are more interesting problems.
Bas |
|
|
|