Author Topic: Keithley 2001 CAL EEPROM: how to calculate the checksum?  (Read 1566 times)

0 Members and 1 Guest are viewing this topic.

Offline Le_BassisteTopic starter

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: de
Keithley 2001 CAL EEPROM: how to calculate the checksum?
« on: December 03, 2019, 02:01:44 pm »
i accidentially screwed the contents of the CAL EEPROM in a KEI2001 while attempting a "brain transplant" (i.e., exchanging the single-rom digital board with a dual-rom version). :palm:
however, i have all cal constants available from a previous GPIB dump, and i have them also available in the required IEEE format. i can re-program the EEPROM with those values via a TL866, but i'm struggling to figure out the correct way to calculate the checksum over the hundred cal constants. TiN's article about the way to calculate it left me puzzled, to say the least.
would be great, if somebody could give me an example of how to do that properly, ELI5-style. :-DD

An assertion ending with a question mark is a brain fart.
 

Online macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #1 on: December 03, 2019, 05:13:39 pm »
If you would link to "TiN's article" that you refer to, that would be very helpful indeed. Don't expect people to do that extra legwork when you are asking for their help.
 

Offline Le_BassisteTopic starter

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: de
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #2 on: December 03, 2019, 09:28:46 pm »
If you would link to "TiN's article" that you refer to, that would be very helpful indeed.
yep, point taken. here it is: https://xdevs.com/fix/kei2001/, section "Calibration decode for EEPROM contents", especially the remark in the table, "16-bit summator of cal values 0×18 – 0×108 , rotated byte by 4", which i don't understand.

Don't expect people to do that extra legwork when you are asking for their help.

just for clarification, i'm not expecting anybody to help me, nor to do any "legwork" for me.  i'm asking for help. big difference.  :horse:
if that's presenting an insult to you, my apologies.  :-+


An assertion ending with a question mark is a brain fart.
 
The following users thanked this post: Zucca

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14181
  • Country: de
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #3 on: December 03, 2019, 09:59:41 pm »
As I understand it the roted byte by 4 means shifting the bits 4 to one side with roll over. With 4 shifts  the direction of the shifts does no matter. A different way to describe is is swapping the lower and upper 4 bits in each byte (likely done to better catch a problem like a bad data line). I think the sum as 16 bit numbers should be relatively clear.
 

Offline Le_BassisteTopic starter

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: de
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #4 on: December 04, 2019, 11:54:25 am »
thanks kleinstein, tried that:
i've pulled the cal data in the range 0x18 to 0x108 from a working data set as follows:
Code: [Select]
3FF0014B041616F3
3F2A5D4FB38842F1
4024041A6320BB9A
3F2B04CD5DCE72F1
3FF0002564D567E4
3F0DF0C59D100BC3
402402A75A1BE7E1
3F1F5A705E6BA5E2
4058FFBC920EDC9B
407F0466AC3C8EC4
3F6D1AE86447A000
3F70A1A95DDFC800
3F58F27E0CCFA000
3F6D1AE86447A000
3F70A1A95DDFC800
4060800000000000
4061200000000000
0
3FF0000000000000
3FF0000000000000
3FF0013A92A30553
3FF000D1B71758E2
3FB999999999999A
3FF0000000000000
4060000000000000
4060800000000000
4060800000000000
4061200000000000
0
0
0

after a 4-byte rotate, that would give the following 16-bit summands:
Code: [Select]
014B
5D4F
041A
04CD
0025
F0C5
02A7
5A70
FFBC
0466
1AE8
A1A9
F27E
1AE8
A1A9
8000
2000
0000
0000
0000
013A
00D1
9999
0000
0000
8000
8000
2000
0000
0000
0000

summing them all up into one 16 bit value gives 80E8. however, the checksum in the EEPROM at 0x110 reads B7CD.
what am i missing?

An assertion ending with a question mark is a brain fart.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14181
  • Country: de
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #5 on: December 04, 2019, 05:15:31 pm »
I think the describtion is more like to first separate the data to 16 bit chunk, than do the sum (ignoring overflow)  and only finally do a 4 bit shift / nibble swapping for the 2 byte sum.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #6 on: December 04, 2019, 10:30:43 pm »
I get 0xb7fd.
 

Offline Le_BassisteTopic starter

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: de
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #7 on: December 04, 2019, 11:33:21 pm »
I think the describtion is more like to first separate the data to 16 bit chunk, than do the sum (ignoring overflow)  and only finally do a 4 bit shift / nibble swapping for the 2 byte sum.
sounds reasonable, but it's not clear to me where you got the 4 bit shift rule from in TiN's description.
anyway, sum of all 16 bit chunks (w/o any further bit shifting, truncated to 16 bits) results in 7FDB. still not correct
An assertion ending with a question mark is a brain fart.
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #8 on: December 04, 2019, 11:53:36 pm »
Sounds like an Xmas horror story.  :-DD

On topic - I don't remember, but most likely big endian conversion involved and _probably_ rotate by 4 was meant to be swap the nibbles around .
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Online fzabkar

  • Super Contributor
  • ***
  • Posts: 2260
  • Country: au
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3238
  • Country: gb
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #10 on: December 05, 2019, 01:47:08 am »
I think the describtion is more like to first separate the data to 16 bit chunk, than do the sum (ignoring overflow)  and only finally do a 4 bit shift / nibble swapping for the 2 byte sum.
sounds reasonable, but it's not clear to me where you got the 4 bit shift rule from in TiN's description.
anyway, sum of all 16 bit chunks (w/o any further bit shifting, truncated to 16 bits) results in 7FDB. still not correct

Apply the 4 bit shift to your result and you get the same B7FD which others have calculated.
 

Offline Le_BassisteTopic starter

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: de
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #11 on: December 05, 2019, 08:12:34 am »
mikerj, got that. however, for the given dataset, my KEI2001 decided the correct checksum to be B7CD, not B7FD
An assertion ending with a question mark is a brain fart.
 

Offline Le_BassisteTopic starter

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: de
Re: Keithley 2001 CAL EEPROM: how to calculate the checksum?
« Reply #12 on: December 05, 2019, 08:13:55 am »
Sounds like an Xmas horror story.  :-DD

On topic - I don't remember, but most likely big endian conversion involved and _probably_ rotate by 4 was meant to be swap the nibbles around .

ah, missed the big endian. will try that!
by the way, that poor franken-thingy is a well known ex-patient of yours.  >:D
« Last Edit: December 05, 2019, 08:16:05 am by Le_Bassiste »
An assertion ending with a question mark is a brain fart.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf