HP 3478A ROM modification - relative mode - Page 1
Forum section: electronics / testgear

author: fenugrec
author_rank: Frequent Contributor
timestamp: December 18, 2018, 05:04:02 am
content: I've been working on this for a while... I've always wanted a "relative mode" or "Zero" function for the Ohms mode, to cancel out probe resistance.Pretty straightforward:- analyzed the ROM disassembly- implemented a basic emulator in MAME (merged, should be in next release !)- write some test patches,https://github.com/fenugrec/hp3478a_rompatch- bang my head against the wall a.k.a. doing BCD math in 80's vintage MCS-48 assemblerAnd finally... it (mostly) works !I messed up something in the annunciator toggling, I'll have to run it under MAME again to see what's up with that. Actually I didn't emulate the annunciators at all so it was a bit of a shot in the dark...

author: coromonadalix
author_rank: Super Contributor
timestamp: December 18, 2018, 08:09:32 pm
content: SeriouslyWOW WOW WOW

author: macboy
author_rank: Super Contributor
timestamp: December 19, 2018, 04:08:18 pm
content: Now that is my kind of hack. I really like this.I did something similar to a TTi TSX1820 power supply. I read out the code in its PIC microcontroller (no code protect bit was set!), disassembled and reverse engineered it, and added a few features. It can now calculate and display Watts, Watt-hours, and Amp-hours, and it periodically sends this and the volt/amp readings to an optically isolated serial port for PC logging. The Amp-hours display is very handy when using the supply to charge batteries. One of these days I'll post a thread about that hack...

author: glarsson
author_rank: Frequent Contributor
timestamp: December 19, 2018, 05:55:14 pm
content: TTi has also implemented a similar hack. It is called TSX1820P. :-)

author: kirill_ka
author_rank: Frequent Contributor
timestamp: December 20, 2018, 03:32:42 pm
content: Quote from: fenugrec on December 18, 2018, 05:04:02 amYou might want to take a look at my project:https://www.eevblog.com/forum/projects/project-extending-hp3478a-functionality/I've also implemented "Zero" function by other means.It would be much nicer if I had access to full keyboard via GPIB. Do you think it would be easy to modify ROM in that way?

author: macboy
author_rank: Super Contributor
timestamp: December 20, 2018, 04:34:26 pm
content: Quote from: kirill_ka on December 20, 2018, 03:32:42 pmI remember that project, that was another very cool mod. Thanks for releasing the code into the wild.

author: fenugrec
author_rank: Frequent Contributor
timestamp: December 21, 2018, 02:07:27 am
content: Quote from: kirill_ka on December 20, 2018, 03:32:42 pmI completely missed it ! Interesting approach, but I'm beginning to think both our projects would've been simpler just by completely replacing the main CPU with anything that runs faster than 400Khz (5.9Mhz/15)...QuoteVery doable.See the keypad handlers athttps://github.com/fenugrec/hp3478a_utils/blob/master/ROM_disasm/dc118.d48#L2190The GPIB RX code is a bit more complex and I really didn't investigate a lot. When a character is received it's looked up in a table (GPIB_alphatbl @ 1306)https://github.com/fenugrec/hp3478a_utils/blob/master/ROM_disasm/dc118.d48#L2438then some stuff happens ( I forget) and then there's a jump table here (GPIBjmp_1407)https://github.com/fenugrec/hp3478a_utils/blob/master/ROM_disasm/dc118.d48#L2654The only ones I remember checking are 'X' and 'W' for read/writing to CAL RAM :https://github.com/fenugrec/hp3478a_utils/blob/master/ROM_disasm/dc118.d48#L2817so the other stuff you may be interested in would definitely be around there.

author: kirill_ka
author_rank: Frequent Contributor
timestamp: December 21, 2018, 09:04:25 am
content: Quote from: fenugrec on December 21, 2018, 02:07:27 amI think you underestimate the cost of developing a complete firmware like that. I won't do it for free, lets put it in this wayQuote from: fenugrec on December 21, 2018, 02:07:27 amThank you. I'll look into this.

author: fenugrec
author_rank: Frequent Contributor
timestamp: December 23, 2018, 12:20:28 am
content: Quote from: kirill_ka on December 21, 2018, 09:04:25 amIt's just an idea, but I didn't mean re-writing the entire firmware from scratch. A lot of the code is not very critical and could be simply translated/recompiled : the MCS48 instruction set is very simple, and with each opcode taking 15 (!) clock cycles to execute, it wouldn't take a lot of modern processing power to emulate that. The only time-sensitive code I've seen is the bit-banged async serial comms with the analog CPU. The only other difficulty I see is managing the chip-select lines for DIP switch / GPIB / LCD multiplexing. But again, even a cheap ARM mcu clocked at 48MHz has around 100x the throughput of the 8039...But yeah, I wouldn't do it either - not at this stage.

author: Ringmodulator
author_rank: Regular Contributor
timestamp: September 16, 2019, 07:21:20 am
content: Hi,I would appreciate, if someone could post the patched rom file for the relative mode.ThanksChris

author: fenugrec
author_rank: Frequent Contributor
timestamp: September 16, 2019, 01:08:12 pm
content: Quote from: Ringmodulator on September 16, 2019, 07:21:20 amHi,I didn't upload it yet, mainly because it wasn't ready for release, and I wanted to get that annunciator working. Also hoping that an assembly enthusiast / BCD veteran will show up and look at the original math code to tell me if I'm understanding it correcly.

author: fenugrec
author_rank: Frequent Contributor
timestamp: November 04, 2020, 02:29:21 pm
content: Quote from: fenugrec on September 16, 2019, 01:08:12 pm1 year later, after using used relative-mode a lot recently and not having the the MATH annunciator to show was very error prone when changing mode / range.Finally understood the disassembly a bit better and was able to make MATH appear ! And with the help of MAME devs, I added the annun segments the emulated LCD too :It's almost "good enough" , now I want to exit relative-mode as soon as any key is pressed. As I said, it's way too error prone otherwise. Once that works I should be able to post a patched ROM ready to burn.

author: uski
author_rank: Frequent Contributor
timestamp: November 06, 2020, 12:10:42 am
content: Pretty awesome to see a multimeter emulated in MAME...We have a homebrew scene on multimeters now. Who expected that years ago ?Can't wait to see what else you will add

author: fenugrec
author_rank: Frequent Contributor
timestamp: November 29, 2020, 07:06:12 pm
content: I think this project is now "done".- MATH shows !- meter will not activate relative mode unless in Manual range (otherwise the saved offset doesn't make any sense if the range changes)- meter will exit relative mode when any key is pressedsource code & patched ROM ready to test (currently running it on my meter)https://github.com/fenugrec/hp3478a_rompatchdemo :