Electronics > Repair

Quick Repair: Standford Research PS350 5KV 5mA(Fixed but working on calibration)

<< < (3/11) > >>

Tony_G:
Great post. What simulator are you using?

TonyG

smgvbest:
I am using this one "Z80 Simulator IDE v10.36" from http://www.oshonsoft.com/

Attached are the memory dump and sim file along with my bin file and most recent update to the disassembly
I had to zip them to attach them


nidlaX:
That was definitely a "DON'T turn it on before taking it apart" type of repair! :-BROKE :-+

alm:
Did a bit of digging in the rom/ram dump you posted. The data at 0x191C looks indeed like a GPIB command table. The structure is a bit odd:

--- Code: ---ROM:191C                 db '$'
ROM:191D                 dw 1935h
ROM:191F                 db '*'
ROM:1920                 dw 193Bh
ROM:1922                 db 'H'
ROM:1923                 dw 196Eh
ROM:1925                 db 'I'
ROM:1926                 dw 1979h
ROM:1928                 db 'S'
ROM:1929                 dw 1989h
ROM:192B                 db 'T'
ROM:192C                 dw 198Fh
ROM:192E                 db 'V'
ROM:192F                 dw 199Ah
ROM:1931                 db 'W'
ROM:1932                 dw 19AAh
ROM:1934                 db    0
ROM:1935                 db  44h ; D
ROM:1936                 db  41h ; A
ROM:1937                 db  43h ; C
ROM:1938                 dw 1CBEh
ROM:193A                 db    0
ROM:193B                 db  43h ; C
ROM:193C                 db  4Ch ; L
ROM:193D                 db  53h ; S
ROM:193E                 dw 1A6Ah
ROM:1940                 db  45h ; E
ROM:1941                 db  53h ; S
ROM:1942                 db  45h ; E
ROM:1943                 dw 1E3Ch
ROM:1945                 db  45h ; E
ROM:1946                 db  53h ; S
ROM:1947                 db  52h ; R
ROM:1948                 dw 1EAEh
ROM:194A                 db  49h ; I
ROM:194B                 db  44h ; D
ROM:194C                 db  4Eh ; N
ROM:194D                 dw 19B0h
ROM:194F                 db  50h ; P
ROM:1950                 db  53h ; S
ROM:1951                 db  43h ; C
ROM:1952                 dw 1E72h
ROM:1954                 db  52h ; R
ROM:1955                 db  43h ; C
ROM:1956                 db  4Ch ; L
ROM:1957                 dw 1D5Ah
ROM:1959                 db  52h ; R
ROM:195A                 db  53h ; S
ROM:195B                 db  54h ; T
ROM:195C                 dw 1A4Eh
ROM:195E                 db  53h ; S
ROM:195F                 db  41h ; A
ROM:1960                 db  56h ; V
ROM:1961                 dw 1D35h
ROM:1963                 db  53h ; S
ROM:1964                 db  52h ; R
ROM:1965                 db  45h ; E
ROM:1966                 dw 1E06h
ROM:1968                 db  53h ; S
ROM:1969                 db  54h ; T
ROM:196A                 db  42h ; B
ROM:196B                 dw 1F08h
ROM:196D                 db    0
ROM:196E                 db  56h ; V
ROM:196F                 db  4Fh ; O
ROM:1970                 db  46h ; F
ROM:1971                 dw 1A14h
ROM:1973                 db  56h ; V
ROM:1974                 db  4Fh ; O
ROM:1975                 db  4Eh ; N
ROM:1976                 dw 1A24h
ROM:1978                 db    0
ROM:1979                 db  4Ch ; L
ROM:197A                 db  49h ; I
ROM:197B                 db  4Dh ; M
ROM:197C                 dw 1B7Fh
ROM:197E                 db  4Fh ; O
ROM:197F                 db  55h ; U
ROM:1980                 db  54h ; T
ROM:1981                 dw 1C7Eh
ROM:1983                 db  54h ; T
ROM:1984                 db  52h ; R
ROM:1985                 db  50h ; P
ROM:1986                 dw 1BEEh
ROM:1988                 db    0
ROM:1989                 db  4Dh ; M
ROM:198A                 db  4Fh ; O
ROM:198B                 db  44h ; D
ROM:198C                 dw 1C9Eh
ROM:198E                 db    0
ROM:198F                 db  43h ; C
ROM:1990                 db  4Ch ; L
ROM:1991                 db  52h ; R
ROM:1992                 dw 1A3Bh
ROM:1994                 db  4Dh ; M
ROM:1995                 db  4Fh ; O
ROM:1996                 db  44h ; D
ROM:1997                 dw 1CFFh
ROM:1999                 db    0
ROM:199A                 db  4Ch ; L
ROM:199B                 db  49h ; I
ROM:199C                 db  4Dh ; M
ROM:199D                 dw 1B06h
ROM:199F                 db  4Fh ; O
ROM:19A0                 db  55h ; U
ROM:19A1                 db  54h ; T
ROM:19A2                 dw 1C5Dh
ROM:19A4                 db  53h ; S
ROM:19A5                 db  45h ; E
ROM:19A6                 db  54h ; T
ROM:19A7                 dw 1A87h
ROM:19A9                 db    0
ROM:19AA                 db  4Fh ; O
ROM:19AB                 db  52h ; R
ROM:19AC                 db  44h ; D
ROM:19AD                 dw 1D77h
ROM:19AF                 db    0

--- End code ---
The data at the top contains the first character (e.g. '*' at 191F) and a reference to an array of:

--- Code: ---struct {
    char cmd[3];
    void *addr;
}

--- End code ---
Terminated by a 00. For '*', cmd would be CLS, IDN, etc. The complete list:

--- Code: ---$DAC
*CLS
*ESE
*ESR
*IDN
*PSC
*RCL
*RST
*SAV
*SRE
*STB
HVOF
HVON
ILIM
IOUT
ITRP
SMOD
TCLR
TMOD
VLIM
VOUT
VSET
WORD

--- End code ---

The *addr are code references that will presumably take the desired action. Parsing seem to take place around 1587:

--- Code: ---ROM:1587 parse_gpib_commands:                    ; CODE XREF: read_gpib_key+ACp
ROM:1587                                         ; parse_gpib_commands+E4j
ROM:1587                 ld      a, (word_40EB)
ROM:158A                 and     a
ROM:158B                 ret     z
ROM:158C                 call    sub_17D0
ROM:158F                 call    sub_17F1
ROM:1592                 ld      c, 0
ROM:1594                 jp      z, loc_161B
ROM:1597                 call    sub_181B
ROM:159A                 ld      b, a
ROM:159B                 ld      c, 1
ROM:159D                 ld      hl, 191Ch       ; data_gpib_commands
ROM:15A0
ROM:15A0 loc_15A0:                               ; CODE XREF: parse_gpib_commands+24j
ROM:15A0                 ld      a, (hl)
ROM:15A1                 inc     hl
ROM:15A2                 and     a
ROM:15A3                 jp      z, end_of_string
ROM:15A6                 cp      b
ROM:15A7                 jr      z, loc_15AD
ROM:15A9                 inc     hl
ROM:15AA                 inc     hl
ROM:15AB                 jr      loc_15A0

--- End code ---

A cursory look at the code at 1cbe (referenced by $DAC) suggests that it does not accept $DAC?, but expects a value:

--- Code: ---ROM:1CBE                 call    check_question_mark
ROM:1CC1                 jp      z, syntax_error
ROM:1CC4                 ld      hl, 1
ROM:1CC7                 ld      a, 0
ROM:1CC9                 call    sub_1851
ROM:1CCC                 jp      nz, end_of_string
ROM:1CCF                 push    hl
ROM:1CD0                 call    sub_17E7
ROM:1CD3                 pop     hl
ROM:1CD4                 jp      nz, syntax_error
ROM:1CD7                 ld      c, 0
ROM:1CD9                 bit     0, l
ROM:1CDB                 jr      z, loc_1CF8
ROM:1CDD                 ld      hl, 0
ROM:1CE0                 ld      a, (byte_412D)
ROM:1CE3                 or      a
ROM:1CE4                 jr      z, loc_1CE8
ROM:1CE6                 set     7, h

--- End code ---
I have not looked into what it does with this value yet.

smgvbest:
@alm
Wow,  you're far better at this than I am.   Thank you.
That shed a bunch of light on things.
the not supporting $DAC? makes sense since the DAC can not be read.   they would have to Save the current DAC value and return it and guess they didn't need that feature to calibrate.

given that setting the DAC maybe possible what I imagine they do then is basically (and crudely)

HVON
FOR TEST_VALUE IN 50,1000,2000,3000,4000,5000  < just random values but they would have fixed test points
DO
VSET TEST_VALUE
READ OUTPUT VOLTAGE
 COMPARE TEST_VALUE TO OUTPUT
 IF IN SPEC SAVE TEST_VALUE, OFFSET AND NEXT VALUE
 ELSE  $DAC +/-OFFSET
 LOOP BACK TO READ
DONE
HVOFF

then they would write those offsets to EPROM.
kind of a clunky way of doing it but given the hardware here the only way that would work reliably I think.   they could write to sram for cal but if your battery died you'd loose cal and with not battery monitor they can't alert you to change the battery.


Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod