CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Checksum not the same

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bschriek



Joined: 18 Dec 2007
Posts: 80

View user's profile Send private message Send e-mail

Checksum not the same
PostPosted: Fri Apr 05, 2019 6:50 am     Reply with quote

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: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Apr 05, 2019 9:38 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Mon Apr 08, 2019 12:43 am     Reply with quote

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: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Apr 08, 2019 4:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 08, 2019 11:58 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Tue Apr 09, 2019 1:35 am     Reply with quote

Thank you, problem solved!
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Tue Apr 09, 2019 5:58 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Apr 09, 2019 9:04 am     Reply with quote

That particular one, I found by experimentation just recently.
bschriek



Joined: 18 Dec 2007
Posts: 80

View user's profile Send private message Send e-mail

PostPosted: Wed Apr 10, 2019 12:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Apr 10, 2019 3:03 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Apr 10, 2019 3:33 am     Reply with quote

Thanks, just forget the whole Checksum idea......
I think there are more interesting problems.

Bas
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group