Adding new system - HP 3478A multimeter
#114162
11/04/18 09:09 PM
11/04/18 09:09 PM
|
Joined: Nov 2018
Posts: 11
fenugrec
OP
Member
|
OP
Member
Joined: Nov 2018
Posts: 11
|
Hi, Just thought I'd share a project I'm starting; I expect I'll need some help with MAME internals to get this done ! Target is a popular old piece of electronic test equipment, the HP 3478A DMM. Full service manual and shematics are available, as well as a full ROM dump hosted on KO4BB . I have dumped my own unit with a logic analyzer and confirmed they were identical. Some pics on https://sigrok.org/wiki/HP_3478AHardware is fairly simple, with a twist. - Intel i8039 (MCS-48 family, already supported in MAME I believe, for some "kaypro" gadget ?) , internal OTP ROM not used - 8kB EPROM (dumped) - 256-byte calibration RAM, also dumped but not function-critical - LCD display module accessed through a weird 4-signal serial link; I've identified that code in the ROM so the first iterations will have those parts patched / bypassed - Main CPU talks to a secondary CPU on the analog side, over a half-duplex serial link. This part is of no interest to me, and will be summarily patched too. The twist is that the 8039 has a 4kB address space. The 3478 hardware implements hardware banking, where one of the IO pins drives the A12 address line. My partially annotated ROM disassembly along with some notes : https://github.com/fenugrec/hp3478a_utils/tree/master/ROM_disasmMy goal isn't to have a full emulation working - a bit meaningless for a test instrument. But I'd like to have the firmware run properly and handle the UI (4x4 keypad and display) so I can move on to part 2, which is modifying the ROM to add a missing feature.
Last edited by fenugrec; 11/04/18 10:24 PM. Reason: added direct ROM link
|
|
|
Re: Adding new system - HP 3478A multimeter
[Re: R. Belmont]
#114164
11/05/18 12:39 AM
11/05/18 12:39 AM
|
Joined: Nov 2018
Posts: 11
fenugrec
OP
Member
|
OP
Member
Joined: Nov 2018
Posts: 11
|
Banked address spaces are something we get day in day out around this place so that's not a problem. The 4-wire LCD controller sounds like possibly I2C or some similar serial protocol. Was there software for any HP computers that talked to this thing over (G/H)PIB?
Thanks. Do you (or anyone) have an example of a device I could refer to that implements this kind of simple banking ? LCD : I2C wasn't very popular when these units were introduced; it's actually a clocked serial protocol that IIRC some other HP units share and I think has been documented to some extent, I vaguely remember an eevblog thread about this. GPIB/HPIB indeed : the manuals mention an HP 85B / 9000 series computer, not sure about special software - probably not, the commands are pretty simple. That's about the extent of my knowledge of that side of things, though.
|
|
|
Re: Adding new system - HP 3478A multimeter
[Re: fenugrec]
#114210
11/09/18 03:41 PM
11/09/18 03:41 PM
|
Joined: Nov 2018
Posts: 11
fenugrec
OP
Member
|
OP
Member
Joined: Nov 2018
Posts: 11
|
Ah ! with some pointers from the folks in #mame-dev, I was finally able to compile mame and add an initial driver for this. hp3478 git branchSo far only the CPU and hardware ROM banking are implemented; seems to work so far. Any comments ? especially on the IO port handling, I mix-and-matched code snippets found in other drivers... next steps, ideas are very welcome : - find a way to import my annotated disasm comments / symbols into mame's debugger so I don't go insane for the rest of this project - patch / hook ? into ROM display functions to implement a primitive display without having to emulate the serial protocol - patch (maybe the cheat mechanisms would be useful here ?) a few areas of the ROM that would hang waiting for unemulated hardware - implement keypad reading and tie to a UI element, or maybe just keyboard shortcuts. Don't want to spend hours on this
|
|
|
Re: Adding new system - HP 3478A multimeter
[Re: fenugrec]
#114234
11/11/18 12:15 AM
11/11/18 12:15 AM
|
Joined: May 2012
Posts: 494
shattered
Senior Member
|
Senior Member
Joined: May 2012
Posts: 494
|
next steps, ideas are very welcome : - find a way to import my annotated disasm comments / symbols into mame's debugger so I don't go insane for the rest of this project - patch / hook ? into ROM display functions to implement a primitive display without having to emulate the serial protocol - patch (maybe the cheat mechanisms would be useful here ?) a few areas of the ROM that would hang waiting for unemulated hardware - implement keypad reading and tie to a UI element, or maybe just keyboard shortcuts. Don't want to spend hours on this
You can abuse breakpoints to do some of these - breakpoint handler will execute debugger expressions (print messages to debugger window or logs, modify registers and memory &c). For example, a "bp fc4b8,1,{do cx=1;go}" will pretend that some check has actually passed. Another example: log syscall handler entry and pretty-print its arguments (this is for GRiD Compass driver): bpset fec9c,1,{ logerror "%% OsDskDriver "; go } bpset feca5,1,{ temp2 = w@(ss*10+bp+0xc); temp1 = w@(ss*10+bp+0xc+2); temp0 = temp2 + temp1*10; logerror "(r = %2d) (xn %04x pBuffer %08x pos %08x length %04x mode %02x numbuf %02x intAddr %02x pOverflow %08x\n" ,w@(ss*10+bp+10) ,w@(temp0) ,d@(temp0+2) ,d@(temp0+2+4) ,w@(temp0+2+4+4) ,b@(temp0+2+4+4+2) ,b@(temp0+2+4+4+2+1) ,b@(temp0+2+4+4+2+1+1) ,d@(temp0+2+4+4+2+1+1+1) ; go }
|
|
|
Re: Adding new system - HP 3478A multimeter
[Re: fenugrec]
#114239
11/11/18 04:35 AM
11/11/18 04:35 AM
|
Joined: Nov 2018
Posts: 11
fenugrec
OP
Member
|
OP
Member
Joined: Nov 2018
Posts: 11
|
Thanks for the replies. You can abuse breakpoints to do some of these Ah yes, but can those work from within a device driver ? That's actually so ugly, I'm embarassed of even considering it. Other things I've thought of was inserting illegal opcodes and if possible trapping those. Meh. and then "source file.txt" when you start the debugger. Ok, that could work. So, I spent the evening writing LCD emulation code I didn't want to write. It started out because I thought it would marginally simpler... still not sure about that one. On the plus side : ![[Linked Image]](http://imgbin.ca/image.uploads/10-11-2018/original-ef0491a743f1cbf6fa86924e0d92c8d9.png) "TSET FLES" => SELF TEST, indeed. What would be the simplest option to have this displayed "properly" (i.e. not in the error log !), with minimum amount of pain ? "terminal" sounds like not what I want; I saw references to 16-segment LEDs but I can't be bothered to map the entire charset to segments. There has to be a raw text renderer, I haven't found it yet...
|
|
|
Re: Adding new system - HP 3478A multimeter
[Re: fenugrec]
#114251
11/11/18 02:48 PM
11/11/18 02:48 PM
|
Joined: Nov 2018
Posts: 11
fenugrec
OP
Member
|
OP
Member
Joined: Nov 2018
Posts: 11
|
Granted, the artwork system would be the highest quality solution, but more trouble than I think is worth for this particular project... Anyway, I have some medium-quality photos of the front panel and LCD segments ( ![[Linked Image]](http://imgbin.ca/image.uploads/11-11-2018/original-1b8428f0c23996eae649b9fc098bab78.jpg) ), but it doesn't seem like there's an official Artwork repo ? I still think I'm just going to try the simplest text rendering I can find...
|
|
|
|
Forums9
Topics8,625
Posts112,794
Members4,839
|
Most Online324 Dec 20th, 2018
|
|
|