Author Topic: HP 3478A: How to read/write cal SRAM  (Read 30555 times)

0 Members and 1 Guest are viewing this topic.

Offline pqass

  • Regular Contributor
  • *
  • Posts: 194
  • Country: ca
Re: HP 3478A: How to read/write cal SRAM
« Reply #125 on: August 29, 2020, 05:54:17 pm »
Specifically, the -d switch forgets to remove the end-of-line line-feed character (0x0A) before processing the line.

Hi, I got the notification on github concerning this issue, but I can't access my code and crap so I have nothing to suggest until I get back in ~2 weeks. Ping me again if you don't hear from me by then.
But if it's just a processing issue it should be trivial to patch in the meantime (I think we got the math part mostly perfect ? except maybe clamping the gain digits to [-4..+5] , I forget the details)

False alarm.  You're good.  User fed cal data with embedded new-lines ("\n") for -d.

Although, it wouldn't hurt to put warnings if data in a particular field is suspect. 
eg.  non-BCD digits appearing in raw offset, offset and gain fields without leading "4" hex nibble, should check crc behind the scene when executing -d to validate the line, etc.
« Last Edit: August 29, 2020, 05:57:42 pm by pqass »
 

Offline cbueche

  • Contributor
  • Posts: 8
  • Country: ch
Re: HP 3478A: How to read/write cal SRAM
« Reply #126 on: August 30, 2020, 01:16:07 pm »
pqpass with your script I now get the same results, so let's assume all is good and proceed to the new battery soldering :-)
Fenugrec no worries and no stress, thanks for your great utility ! I haven't worked with C since 1991 but I think there is no bug, only a user's messing-up :-)
« Last Edit: August 30, 2020, 01:17:51 pm by cbueche »
 

Offline cbueche

  • Contributor
  • Posts: 8
  • Country: ch
Re: HP 3478A: How to read/write cal SRAM
« Reply #127 on: August 30, 2020, 03:27:37 pm »
ok I messed up :( I followed the instructions : soldered a 4V battery-pack + serial-diode parallel to C510, measured the tension there (had ~ 3.5V), removed the old calibration-battery, still had about 3.5V over C510 so life was good... soldered new battery in place (my soldering iron is fully-isolated and the multimeter wasn't connected to anything), life was still good... removed the backup 3V source and power-cycled the HP3478A... life wasn't that good anymore... got the infamous "Uncalibrated" error at self-test :wtf: :palm: :-// Really not sure at what step I messed up, maybe a short when desoldering or measuring on C510. Anyway. Time to see how to recover my calibration data...

I adapted my getval.py to be a "putval.py" and passed it my calibration dump, with of course the front-panel "cal" in write-mode.

Code: [Select]
#!/bin/env python3
# usage : python ./putcal.py calibration_data/hp3478_cal_dump_1.bin

import sys
import pyvisa

rm = pyvisa.ResourceManager()
dvm = rm.open_resource('GPIB::16::INSTR')

calfile = sys.argv[1]
with open(calfile, 'r') as file:
    data = file.read().replace('\n', '')

ldata = len(data)
print("got {} bytes from {}".format(ldata, calfile))
if ldata != 256:
    print("input file must be 256 bytes after filering newline chars. Now {} bytes, exit".format(ldata))
    sys.exit(1)

for addr in range(256):
    dval = data[addr]
    print("writing position {} with value {}".format(addr, dval))
    dvm.write_raw(bytes([ord('X'), addr]))
    dvm.write_raw(dval)

dvm.close()
rm.close()

After setting the front-panel "cal" to read-mode again and a power-cycle check, I get "self test ok" again I was able to read back the same calibration data using getval.py and life is good again, the saved data matches what I had at the begining of the whole trip and my HP3478A is good for the next 30 years. Time for pizza + beer :popcorn:

Thanks all for the help !
Charles

 
The following users thanked this post: coromonadalix

Offline pa3gyf

  • Newbie
  • Posts: 2
  • Country: nl
Re: HP 3478A: How to read/write cal SRAM
« Reply #128 on: June 03, 2021, 08:32:15 pm »
Hi all,

Sorry for the likely necrobump here, but I managed to back up the calibration data of my HP-3478A mostly using the info from this thread! So big thanks!

And here's the cal data <tried but failed to get this into mono-spaced font>:

[jan@rush ~]$ hexdump pa3gyf-hp3478a-01.cal

0000000 4040 4040 4842 4140 4543 4440 484e 4040
0000010 4040 4742 4341 4f45 4d4e 4040 4040 4040
0000020 4142 4443 4045 404f 4949 4949 4549 4341
0000030 4544 4b45 494b 4949 4949 4149 4443 4c41
0000040 444b 4040 4040 4040 4040 4040 4f40 404f
0000050 4040 4543 4143 4d41 4542 4e4d 4949 4849
0000060 4349 4c41 4c43 4a4c 4948 4949 4849 4149
0000070 424c 4d4f 4f49 4949 4949 4949 4c41 4441
0000080 4a4c 494b 4949 4949 4148 4f4c 4540 494a
0000090 4949 4949 4949 4c41 4e40 4a42 494c 4949
00000a0 4949 4148 4f4c 4540 494a 4949 4949 4849
00000b0 4540 4145 4b44 404b 4040 4341 4240 4545
00000c0 454d 4d4d 4040 4040 4341 4542 4e42 4e41
00000d0 4043 4040 4040 4040 4040 4040 4f4f 4040
00000e0 4340 4345 4342 444c 4d43 404c 4040 4040
00000f0 4040 4040 4040 4f4f 4040 4040 4040 4040
0000100


73,
Jan -pa3gyf
 

Offline pqass

  • Regular Contributor
  • *
  • Posts: 194
  • Country: ca
Re: HP 3478A: How to read/write cal SRAM
« Reply #129 on: June 25, 2021, 01:41:31 am »
Hi all,

Sorry for the likely necrobump here, but I managed to back up the calibration data of my HP-3478A mostly using the info from this thread! So big thanks!

And here's the cal data <tried but failed to get this into mono-spaced font>:

[jan@rush ~]$ hexdump pa3gyf-hp3478a-01.cal

0000000 4040 4040 4842 4140 4543 4440 484e 4040
0000010 4040 4742 4341 4f45 4d4e 4040 4040 4040
0000020 4142 4443 4045 404f 4949 4949 4549 4341
0000030 4544 4b45 494b 4949 4949 4149 4443 4c41
0000040 444b 4040 4040 4040 4040 4040 4f40 404f
0000050 4040 4543 4143 4d41 4542 4e4d 4949 4849
0000060 4349 4c41 4c43 4a4c 4948 4949 4849 4149
0000070 424c 4d4f 4f49 4949 4949 4949 4c41 4441
0000080 4a4c 494b 4949 4949 4148 4f4c 4540 494a
0000090 4949 4949 4949 4c41 4e40 4a42 494c 4949
00000a0 4949 4148 4f4c 4540 494a 4949 4949 4849
00000b0 4540 4145 4b44 404b 4040 4341 4240 4545
00000c0 454d 4d4d 4040 4040 4341 4542 4e42 4e41
00000d0 4043 4040 4040 4040 4040 4040 4f4f 4040
00000e0 4340 4345 4342 444c 4d43 404c 4040 4040
00000f0 4040 4040 4040 4f4f 4040 4040 4040 4040
0000100



73,
Jan -pa3gyf


Since you're into necro, I just want to add that I've verified each record of your cal data.


I've reconstituted the raw cal data from your hexdump output by:
1. removing the first 8 chars (address), then
2. swaping each pair in the hex quad, then
3. removing all spaces, then
4. converting each hex pair to ascii to get:

@@@@BH@ACE@DNH@@@@BGACEONM@@@@@@BACDE@O@IIIIIEACDEEKKIIIIIIACDALKD@@@@@@@@@@@OO@@@CECAAMBEMNIIIHICALCLLJHIIIIHIALBOMIOIIIIIIALADLJKIIIIIHALO@EJIIIIIIIAL@NBJLIIIIIHALO@EJIIIIIIH@EEADKK@@@AC@BEEMEMM@@@@ACBEBNANC@@@@@@@@@@@OO@@@CECBCLDCML@@@@@@@@@@@OO@@@@@@


I then fed the raw cal string into my verify.sh script (see my post #123 on the previous page):

000001 40 40 40 42 48 40 41 43 45 40 44 4e 48  >@@@BH@ACE@DNH<   00: raw_offset=000280 raw_gain=13504 offset=+000280 gain=1.013504 crc=ff  30 mV DC
00000e 40 40 40 40 42 47 41 43 45 4f 4e 4d 40  >@@@@BGACEONM@<   01: raw_offset=000027 raw_gain=135fe offset=+000023 gain=1.013488 crc=ff  300 mV DC
00001b 40 40 40 40 40 42 41 43 44 45 40 4f 40  >@@@@@BACDE@O@<   02: raw_offset=000002 raw_gain=13450 offset=+000002 gain=1.013450 crc=ff  3 V DC
000028 49 49 49 49 49 45 41 43 44 45 45 4b 4b  >IIIIIEACDEEKK<   03: raw_offset=999995 raw_gain=13455 offset=-000005 gain=1.013455 crc=ff  30 V DC
000035 49 49 49 49 49 49 41 43 44 41 4c 4b 44  >IIIIIIACDALKD<   04: raw_offset=999999 raw_gain=1341c offset=-000001 gain=1.013406 crc=ff  300 V DC
000042 40 40 40 40 40 40 40 40 40 40 40 4f 4f  >@@@@@@@@@@@OO<   05: raw_offset=000000 raw_gain=00000 offset=+000000 gain=1.000000 crc=ff  <not used>
00004f 40 40 40 43 45 43 41 41 4d 42 45 4d 4e  >@@@CECAAMBEMN<   06: raw_offset=000353 raw_gain=11d25 offset=+000235 gain=1.010725 crc=ff  AC V
00005c 49 49 49 48 49 43 41 4c 43 4c 4c 4a 48  >IIIHICALCLLJH<   07: raw_offset=999893 raw_gain=1c3cc offset=-000107 gain=1.006256 crc=ff  30 Ohm 2W/4W
000069 49 49 49 49 48 49 41 4c 42 4f 4d 49 4f  >IIIIHIALBOMIO<   08: raw_offset=999989 raw_gain=1c2fd offset=-000011 gain=1.006187 crc=ff  300 Ohm 2W/4W
000076 49 49 49 49 49 49 41 4c 41 44 4c 4a 4b  >IIIIIIALADLJK<   09: raw_offset=999999 raw_gain=1c14c offset=-000001 gain=1.006136 crc=ff  3 kOhm 2W/4W
000083 49 49 49 49 49 48 41 4c 4f 40 45 4a 49  >IIIIIHALO@EJI<   10: raw_offset=999998 raw_gain=1cf05 offset=-000002 gain=1.005905 crc=ff  30 kOhm 2W/4W
000090 49 49 49 49 49 49 41 4c 40 4e 42 4a 4c  >IIIIIIAL@NBJL<   11: raw_offset=999999 raw_gain=1c0e2 offset=-000001 gain=1.005982 crc=ff  300 kOhm 2W/4W
00009d 49 49 49 49 49 48 41 4c 4f 40 45 4a 49  >IIIIIHALO@EJI<   12: raw_offset=999998 raw_gain=1cf05 offset=-000002 gain=1.005905 crc=ff  3 MOhm 2W/4W
0000aa 49 49 49 49 49 48 40 45 45 41 44 4b 4b  >IIIIIH@EEADKK<   13: raw_offset=999998 raw_gain=05514 offset=-000002 gain=1.005514 crc=ff  30 MOhm 2W/4W
0000b7 40 40 40 41 43 40 42 45 45 4d 45 4d 4d  >@@@AC@BEEMEMM<   14: raw_offset=000130 raw_gain=255d5 offset=+000088 gain=1.025475 crc=ff  300 mA DC
0000c4 40 40 40 40 41 43 42 45 42 4e 41 4e 43  >@@@@ACBEBNANC<   15: raw_offset=000013 raw_gain=252e1 offset=+000011 gain=1.025181 crc=ff  3A DC
0000d1 40 40 40 40 40 40 40 40 40 40 40 4f 4f  >@@@@@@@@@@@OO<   16: raw_offset=000000 raw_gain=00000 offset=+000000 gain=1.000000 crc=ff  <not used>
0000de 40 40 40 43 45 43 42 43 4c 44 43 4d 4c  >@@@CECBCLDCML<   17: raw_offset=000353 raw_gain=23c43 offset=+000235 gain=1.022643 crc=ff  300 mA/3A AC
0000eb 40 40 40 40 40 40 40 40 40 40 40 4f 4f  >@@@@@@@@@@@OO<   18: raw_offset=000000 raw_gain=00000 offset=+000000 gain=1.000000 crc=ff  <not used>
0000f8 40 40 40 40 40 40                       >@@@@@@<   19: <padding>


CRC=ff means the record is verified.  Yay!
« Last Edit: June 25, 2021, 01:50:34 am by pqass »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf