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

0 Members and 1 Guest are viewing this topic.

Offline MarkL

  • Supporter
  • ****
  • Posts: 1345
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #25 on: May 23, 2017, 12:30:25 pm »
...
The 8048 is quite weird: without CMP or SUB instruction, and also with those pages, mb0/mb1 selector, and bit 12 of program counter. I think I will not be able to find how it works. Is there any thread or progress about that? when I use strings on the ROM I cannot get any useful data. I will need to read the schematics more in detail.
What are you trying to do?

I think it's going to be difficult to simulate operation of the firmware.  It's very dependent on responses from the hardware.  So, you also have to simulate the hardware, which also means simulating the 8039 in the floating section.

If you're trying to discover the CRC/ECC algorithm, I think you're going to need a logic analyzer attached to a running meter as I described previously.

If you're looking for other hidden commands, the ones that aren't accounted for are: A G I J L O P Q U V Y.  The 3478A is a fairly simple machine, so I wouldn't expect anything else hidden of significance.

Some other discussion of 3478A firmware disassembly is here:

  http://www.eevblog.com/forum/testgear/3478a-cal-ram-readout-idea

And there's also this thread on the 3468A, which is very similar in design:

  http://www.eevblog.com/forum/testgear/hp-3468a-in-continual-resetinit/


Yeah, the 8048 is very limited.  The SUB instruction can be done with the following:

  CPL A
  ADD A, REG
  CPL A

(Courtesy of the MCS-48 Microcomputer User's Manual.)
 

Offline ramon

  • Contributor
  • Posts: 44
  • Country: tw
Re: HP 3478A: How to read/write cal SRAM
« Reply #26 on: May 24, 2017, 02:04:02 am »
Thanks for those links, they have very useful information.

I am not looking for other gpib commands. I would like to identify the small set of functions that interface with the floating section. How it initiates requests (ohms, VDC, ...) and gets back the data. Also know all the fields of the calibration RAM, including the CRC/ECC algorithm too.

But as I don't have a logic analyzer it will be difficult.

I can try maybe to find out how the alphanumeric display works. I have seen that it is using Ports P20 to P23 (P23/PWO=1 Update display, P23/PWO=0 No update). That maybe will be the only way I have to find the correct strings into the ROM.
 

Offline dfrederickson

  • Contributor
  • Posts: 13
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #27 on: May 24, 2017, 03:34:00 am »
The calibration procedure needs so many kinds of expensive calibration devices (in AC,DC,ohms, etc...) that it doesn't make any sense to have such easy-to-turn calibration switch in the front panel. How many devices should have been uncalibrated by mistake?.
Our 3478's have a calibration sticker over the front-panel switch, plus, undocumented commands need to be sent, so I'd say not very many.

Quote
Do they did that on purpose to increase earnings from maintenance services?
Most folks get their instruments calibrated by a third party, so probably not.

If you're trying to discover the CRC/ECC algorithm, I think you're going to need a logic analyzer attached to a running meter as I described previously.

I don't know the algorithm, but I do know the default values for the 3468:

0000000000000000
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000FFFF
000000000000000


So for a default gain of 1 (maybe saved as gain-1) and an offset of zero, the ECC checksum is 0xFFFF.

I suspect the 3478 checksum is similar.
 

Offline nfmax

  • Frequent Contributor
  • **
  • Posts: 749
  • Country: gb
Re: HP 3478A: How to read/write cal SRAM
« Reply #28 on: June 13, 2017, 12:23:34 am »
Here is a short Python 3 program to download the calibration RAM and print it to stdout, using the tentatively identified formatting. It uses the PyVISA library and so should run on any platform that has a VISA implementation. I tested it on Windows 7, using the Keysight IO libraries with a 82357B USB/GPIB controller.

The VISA address of my DVM is hard-coded in the source, but it's easy enough to change.

It seems to work OK, but I am a novice Python programmer, and there are no guarantees!
 
The following users thanked this post: edavid

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 280
  • Country: gb
Re: HP 3478A: How to read/write cal SRAM
« Reply #29 on: June 14, 2017, 03:46:51 am »
Thanks for this information :-+. Backing up thew CAL data was one of the first questions I asked when I got my  meter. It was calibrated but the battery still looked original and a replacement seemed sensible sooner rather than later. Unfortunately this answer didn't come soon enough so after a bit of research I did the replacement without a backup, which was quite nerve racking. I was a major relief when I completed the task and got the 'SELF TEST OK' message on power up! :phew:

I have since written a program to control the 3478A. It still needs a bit of work on it but I am thinking of  including the CAL backup/restore functionality into it. The only problem I have, is that I am using an Arduino based GPIB adapter. As far as I know, there is no NI driver for it, so I'm using direct COM port communication. I will upload the source somewhere when its ready though. It is written inn QT and although I'm currently working on Windows, I will also test it on Linux. In the meantime I will keep an eye on this thread for further developments.

 
The following users thanked this post: 3db

Offline dfrederickson

  • Contributor
  • Posts: 13
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #30 on: June 14, 2017, 06:02:42 am »
As far as I know, there is no NI driver for it, so I'm using direct COM port communication.

Looks like an NI driver can be found here: http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=368
 
The following users thanked this post: 3db

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 280
  • Country: gb
Re: HP 3478A: How to read/write cal SRAM
« Reply #31 on: June 14, 2017, 07:03:55 am »
Thanks. At least it seems one does exist. Unfortunately my version of Labview/NI/IVI does not appear to be supported. It seems to be Labview 2012 SP1f3 version 12.0.1 and came supplied with the Rigol Oscilloscope. Would there not also have to be a driver for the GPIB adapter?

 

Offline dfrederickson

  • Contributor
  • Posts: 13
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #32 on: June 14, 2017, 07:57:45 am »
Sorry.  Yes, the adapter will need a driver to interface to LabVIEW.  It might be easier to just buy an adapter off eBay, like I did.
 

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 280
  • Country: gb
Re: HP 3478A: How to read/write cal SRAM
« Reply #33 on: June 29, 2017, 01:23:49 am »
I have uploaded my HP3478A control program code to GitHub. This is the first time I have ever done that!

https://github.com/WaveyCode/HPRDMM

At present it does not contain the code for reading the calibration data as I'm having lots of trouble acquiring it from the meter. I suspect this is down to the Arduino adapter, but I'm not sure. I've been experimenting with a python script and got something that resembles the output I should be getting but its not 256bytes long and contains the phrase 'CR or LF inserted' which is an error message embedded in the adapter code. Sorry, but I don't have an NI capable GPIB adapter to test with.
 

Offline iainwhite

  • Supporter
  • ****
  • Posts: 302
  • Country: us
  • Measure twice...
Re: HP 3478A: How to read/write cal SRAM
« Reply #34 on: June 30, 2017, 02:08:55 am »
I have been playing with Pigrew's windows C# program   (from  https://github.com/pigrew/HP3478Ctrl )

I forked my own version at  https://github.com/iainkwhite/HP3478Ctrl
and after tinkering a bit, managed to read my cal data.

Here is what I got (formatted to lines of 16 bytes)

Code: [Select]
@@@@BAIBMLOMKL@@
@@BBBLDNBMI@@@@@
BBMMMAMCIIIIIEBM
@MLJEIIIIIIBMCMA
JI@@@@@@@@@@@OO@
@@FFCADAACNFIIIH
GIALLEAJMIIIIHH@
ECC@L@IIIIIHALL@
AK@IIIIII@EDEMJN
IIIIIH@EDCDKJIII
IIIALL@LJDIIIIII
@EDBEKI@@@BFBCLC
A@NB@@@@BFCLEAEM
M@@@@@@@@@@@OO@@
@FFCBDBBCNC@@@@@
@@@@@@OO@@@@@@@@


Edit: add screenshot


« Last Edit: June 30, 2017, 02:18:46 am by iainwhite »
 

Online pigrew

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #35 on: June 30, 2017, 02:24:21 pm »
I have been playing with Pigrew's windows C# program   (from  https://github.com/pigrew/HP3478Ctrl )

I forked my own version at  https://github.com/iainkwhite/HP3478Ctrl
and after tinkering a bit, managed to read my cal data.

Thanks for the changes, I've merged most of the changes back into my branch, and posted a new binary:
https://github.com/pigrew/HP3478Ctrl/releases/tag/v0.20170630

-Nathan
 
The following users thanked this post: kado

Offline WaveyDipole

  • Frequent Contributor
  • **
  • Posts: 280
  • Country: gb
Re: HP 3478A: How to read/write cal SRAM
« Reply #36 on: July 01, 2017, 05:10:20 am »
Sorry.  Yes, the adapter will need a driver to interface to LabVIEW.  It might be easier to just buy an adapter off eBay, like I did.
I had considered that option, but everything I have seen on there so far costs more than the meter did!
Of course, if I had something compatible then I could try pigrew's program!
 

Offline scuba31

  • Newbie
  • Posts: 1
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #37 on: August 13, 2017, 04:23:47 pm »
All,

Thanks to everyone who contributed to (finally) solving this problem!
I had never considered the "hidden GPIB command" possibility.
I was approaching this from the perspective that electronics would need to be designed and built to interface with the 5101 IC inside the multimeter.
I was just starting to lay out a prototype in Kicad when I decided to see if this had been solved in the 8 months since I last checked - and to my surprise, it has.  ;D

I have 3 of these HP3478A multimeters that I replaced the batteries using a torch solder iron.
Using the Visual Basic program provided on this forum, here are the calibration constants that my 3 multimeters report out.


Meter #1

@@@@CEFBB@BBNI@@
@@CDBBL@ANG@@@@@
CBAACLNIIIIIIGBC
LEAKD@@@@@@BBBM@
NL@@@@@@@@@@@OO@
@@GHFBLMCELG@@@@
HEALONCLE@@@@@H@
EELDMM@@@@@A@E@@
MNL@@@@@A@ENCANG
@@@@@A@DEEENK@@@
@@A@ELALN@@@@@@@
@D@N@NM@@@AABCC@
CCNO@@@@AACBE@AO
B@@@@@@@@@@@OO@@
@GHFCMLMBKO@@@@@
@@@@@@OO@@@@@@@@


Meter #2

J@@@BIIB@@ALML@@
@@BIB@BABNM@@@@@
CB@@LNN@IIIIIEB@
LMLJFIIIIIIBOC@E
K@@@@@@@@@@@@OOI
IICEAADABELNIIIH
@H@E@B@LMIIIIGI@
EBDBKNIIIIIH@E@O
AKEIIIIII@EOENJB
IIIIIH@EOCAKBIII
IIH@EOEEJLIIIIIH
@ELLOIN@@@@HBC@@
CON@@@@@@HC@B@ON
C@@@@@@@@@@@OOII
ICEABD@EBLN@@@@@
@@@@@@OO@@@@@@@@


Meter #3

O@@@AHIAEEC@MO@@
@@AGAEBMDMN@@@@@
BAEBEONAIIIIIEAD
N@OJKIIIIIIADON@
JG@@@@@@@@@@@OOI
IIA@BBL@NEL@IIII
@A@EECCLJIIIIIA@
EDNEKEIIIIII@EDN
LJFIIIIIH@ECCAKN
IIIIII@ECD@KMIII
III@ECNCK@IIIIIH
@EMDCKAIIIIBBBDA
CALLIIIIIBBDBELK
G@@@@@@@@@@@OOII
IA@BBE@CMLJ@@@@@
@@@@@@OO@@@@@@@@
 
The following users thanked this post: 3db

Offline Squiddaddy

  • Contributor
  • Posts: 30
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #38 on: September 07, 2017, 10:35:55 am »
Thanks pigrew!! I just downloaded your program and successfully read the SRAM from my 3478 meter.
Has anyone tried to write their values back using your program yet?
I am getting ready to try to replace the battery in my meter, and in case I lose my config, I'd like to know if it works.
I guess I'm gun shy to try it yet. :) I don't like being the guinea pig. LOL

Here are my SRAM values, in case someone is trying to analyze data between all of our posts.
@@@@A@HBCM@MMG@@@@ACBBNENMFIIIII
IBCNDAKAIIIIIABBAB@LJIIIIIGBCAAB
LB@@@@@@@@@@@OO@@@DIGB@MLELKIIII
CB@EC@MLAIIIIID@DDDOKC@@@@@@@ED@
COC@@@@@@@EBONMK@@@@@@@EB@@OH@@@
@@@@ECCLNH@@@@@@ALADMN@IIIIFGCDE
EEKHIIIIIDCCDBCKO@@@@@@@@@@@OO@@
@CAICBLE@ML@@@@@@@@@@@OO@@@@@@@@

Thanks again to everyone involved in coming up with this solution to our problem!!!!
 

Online pigrew

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #39 on: September 07, 2017, 10:51:25 am »
Thanks pigrew!! I just downloaded your program and successfully read the SRAM from my 3478 meter.
Has anyone tried to write their values back using your program yet?
I am getting ready to try to replace the battery in my meter, and in case I lose my config, I'd like to know if it works.
I guess I'm gun shy to try it yet. :) I don't like being the guinea pig. LOL

Here are my SRAM values, in case someone is trying to analyze data between all of our posts.
@@@@A@HBCM@MMG@@@@ACBBNENMFIIIII
IBCNDAKAIIIIIABBAB@LJIIIIIGBCAAB
LB@@@@@@@@@@@OO@@@DIGB@MLELKIIII
CB@EC@MLAIIIIID@DDDOKC@@@@@@@ED@
COC@@@@@@@EBONMK@@@@@@@EB@@OH@@@
@@@@ECCLNH@@@@@@ALADMN@IIIIFGCDE
EEKHIIIIIDCCDBCKO@@@@@@@@@@@OO@@
@CAICBLE@ML@@@@@@@@@@@OO@@@@@@@@

Thanks again to everyone involved in coming up with this solution to our problem!!!!
Well,

I tested it out a while ago, but I think I had to fix a few issues I the code after that. I'm sure the command works, but there is a chance there are still bugs in my code.

-Nathan
 

Offline jca1955

  • Newbie
  • Posts: 3
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #40 on: December 23, 2017, 05:22:26 am »
This has been a great discussion!  For those interested, I have Matlab scripts to read and write a 3478A's calibration SRAM.  More information can be found on these routines at my blog, here: 

http://k6jca.blogspot.com/2017/12/save-and-restore-hp-3478a-calibration.html

If you don't have Matlab, the procedures are (hopefully) straight-forward enough for you to adapt to your language of choice.

- Jeff

P.S.  If using these scripts, you will also need the Mathwork's "Instrument Control" toolbox. 
 

Offline jklasdf

  • Contributor
  • Posts: 25
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #41 on: January 05, 2018, 12:47:45 pm »
I also read back my calibration SRAM using biot's script:

Code: [Select]
$ ./cal-3478a.py hp3478a > cal.txt
$ xxd cal.txt
00000000: 4040 4040 4041 4141 4141 4f4f 4d4c 4040  @@@@@AAAAAOOML@@
00000010: 4040 4040 4141 4144 444f 4440 4040 4040  @@@@AAADDOD@@@@@
00000020: 4141 414e 4240 4e4c 4949 4949 4943 4142  AAANB@NLIIIIICAB
00000030: 434c 454b 4849 4949 4949 4941 424f 444f  CLEKHIIIIIIABODO
00000040: 4a44 4040 4040 4040 4040 4040 4040 4049  JD@@@@@@@@@@@@@I
00000050: 4949 4843 4941 4444 404e 4b49 4949 4949  IIHCIADD@NKIIIII
00000060: 4049 4045 4144 424c 4649 4949 4949 4240  @I@EADBLFIIIIIB@
00000070: 4542 4f42 4b48 4949 4949 4949 4045 4e41  EBOBKHIIIIII@ENA
00000080: 454b 4049 4949 4949 4940 4445 4244 4b4a  EK@IIIIII@DEBDKJ
00000090: 4040 4040 4041 4045 4344 4f4e 4340 4040  @@@@@A@ECDONC@@@
000000a0: 4040 4040 4544 4c4e 4d4c 4040 4040 4041  @@@@EDLNML@@@@@A
000000b0: 4045 4545 424e 4d49 4949 4842 4242 424c  @EEEBNMIIIHBBBBL
000000c0: 4c4e 4a4e 4949 4949 4842 4242 4e4c 414b  LNJNIIIIHBBBNLAK
000000d0: 4240 4040 4040 4040 4040 4040 4040 4949  B@@@@@@@@@@@@@II
000000e0: 4948 4349 4245 4045 4f4b 4540 4040 4040  IHCIBE@EOKE@@@@@
000000f0: 4040 4040 4040 4040 4040 4042 4040 4040  @@@@@@@@@@@B@@@@

For reference, here is the relevant section of my /etc/gpib.conf for the multimeter (you will also need another section for the GPIB adapter). I have my hp 3478a set for decimal code 01 (only dip switch for A1 set, ASCII code character '!' for listen and 'A' for talk):

Code: [Select]
device {
        minor = 0
        name = "hp3478a"
        pad = 1
        sad = 1
}
 

Offline kelchm

  • Regular Contributor
  • *
  • Posts: 58
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #42 on: January 23, 2018, 02:40:37 pm »
Has anyone had luck using an Arduino based GPIB adapter to accomplish this?
 

Offline Squiddaddy

  • Contributor
  • Posts: 30
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #43 on: February 08, 2018, 02:41:24 am »
I used an Agilent USB clone form Ebay, and it worked great. No clue about any Arduino ones though.
I also used Pigrew's program since I use Windows.
I still haven't changed my battery yet since it still has life, but I wanted a backup just in case it died, or if I screwed up changing the battery.

Thanks again to everyone who worked on this issue to at least give us a chance.   :clap:
 

Offline Miti

  • Regular Contributor
  • *
  • Posts: 240
  • Country: ca
Re: HP 3478A: How to read/write cal SRAM
« Reply #44 on: March 01, 2018, 01:19:48 pm »
I have been playing with Pigrew's windows C# program   (from  https://github.com/pigrew/HP3478Ctrl )

I forked my own version at  https://github.com/iainkwhite/HP3478Ctrl
and after tinkering a bit, managed to read my cal data.

Thanks for the changes, I've merged most of the changes back into my branch, and posted a new binary:
https://github.com/pigrew/HP3478Ctrl/releases/tag/v0.20170630

-Nathan

Thanks All for an amazing work!

I have two HP3478A, I replaced the battery on one and the other one follows this weekend. I was able to save the calibration using the Python HP3478A.py, thanks nfmax! When I run pigrew's program I get this exception. I guess I'm missing some Labview components. I have Labview 2016 on my computer, not sure if that Ivi.Visa is something that I have to install separately. Thanks in advance!
« Last Edit: March 01, 2018, 01:22:49 pm by Miti »
That big spark at power up was by design!
 

Offline Miti

  • Regular Contributor
  • *
  • Posts: 240
  • Country: ca
Re: HP 3478A: How to read/write cal SRAM
« Reply #45 on: March 02, 2018, 10:44:22 pm »
I recompiled it with Visual Studio Community Edition and it works now. I've attached what works for me.
That big spark at power up was by design!
 

Online pigrew

  • Frequent Contributor
  • **
  • Posts: 389
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #46 on: March 03, 2018, 12:36:55 am »
Sounds good. Ivi.Visa is the library I use to connect to the equipment. It's a fairly new library (within the last two years), and I linked with version 5.8 which may mean that you'd need to update your GPIB drivers (Keysight or NI) to get my binary to work. The GPIB drivers should also install IVI.Visa library.
 

Offline Squiddaddy

  • Contributor
  • Posts: 30
  • Country: us
Re: HP 3478A: How to read/write cal SRAM
« Reply #47 on: March 09, 2018, 04:35:39 am »
Miti,
Did you replace your battery while powered on, or did you back up the ram, change battery, and then restore ram?
I backed up my ram, but haven't changed out the battery yet. Guess I'm chicken. LOL :D
 

Offline fenugrec

  • Regular Contributor
  • *
  • Posts: 50
  • Country: ca
Re: HP 3478A: How to read/write cal SRAM
« Reply #48 on: March 09, 2018, 09:10:03 am »
Nice !
can't wait to try this on my unit. In the meantime I've written a small utility that verifies checksums and dumps each cal "entry" . Not super useful yet but it's mainly a starting point for when we figure out what each cal entry does.

Code is here for anyone interested : https://github.com/fenugrec/hp3478a_utils

« Last Edit: March 09, 2018, 02:43:05 pm by fenugrec »
 

Offline Miti

  • Regular Contributor
  • *
  • Posts: 240
  • Country: ca
Re: HP 3478A: How to read/write cal SRAM
« Reply #49 on: March 09, 2018, 02:28:14 pm »
Miti,
Did you replace your battery while powered on, or did you back up the ram, change battery, and then restore ram?
I backed up my ram, but haven't changed out the battery yet. Guess I'm chicken. LOL :D

I replaced the batteries on two meters with the power on, after I saved the RAM using both, Python and Windows applications. I plugged the soldering station into a UPS disconnected from AC. Make sure that you also disconnect any other load from the UPS otherwise you may have grounding through that load. For example if a PC is connected to the UPS but the monitor is plugged into the wall, you're grounded.
I didn't need to restore after, all went well. I used Kapton tape to isolate everything around the battery terminals on the PCB, only the "operation" site was exposed like you see in surgeries. :-DMM
The funny thing is that less than an hour after the "surgery" we had a power outage for about a minute.  :-DD Man that was close!
Before I had the guts to do it, I tried the backup/restore on another meter from work that is not used anymore, the type with transformers, mine are newer, with opto couplers and the C application works.
I modified the file and I've got an "Uncalibrated", then I restored it and I've got "Self test OK". One little detail though, when you copy/paste the data from the application window into a text file, place the cursor one row below the last row of data. Do the same when you restore the data, basically copy the last new line or carriage return, otherwise it doesn't work.
I've got the batteries from Sayal (in Toronto) STOCK No. BCC-4194, 3.6V.
I'm not sure if they needed replacement though, both old Panasonic batteries measured over 3.3V and the date code seem to be 2003 . Anyway, it's done,they should be good for another 10 -15 years at least.
The next project, replacing my Tek. 2445B battery backed calibration RAM with F-RAM.
« Last Edit: March 09, 2018, 02:49:34 pm by Miti »
That big spark at power up was by design!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf