So this is something I did a little while ago, but I figured people here might find it useful, or at least interesting.
The 859xE series analyzers made by HP/Agilent have a number of installable options. One of these options is Option 105, the gate option. For the A series analyzers, this is a card. However, for the E series analyzers, HP actually built the gate circuitry into the motherboard. Interestingly, they then provided two ways of adding option 105: one is to send the analyzer back to HP, where they will turn on the internal gate option. If this is too difficult, they can also send out a whole gate card that the customer can install. The internal option shows up as GATE rev B, while the card shows up as GATE rev A.
I figured it would be interesting to figure out how to turn on the gate option in the analyzer as installing a whole option card is rather redundant.
First, the recon: the internal gate module itself just appears as a pair of SMB connectors on the motherboard that must be connected to the back panel with SMB to BNC cables. Then, the module must be enabled in the firmware somehow. These analyzers have a small amount of battery-backed NVRAM, the perfect place to store calibration data and possibly this sort of a 'sofware switch.' The service manual also lists some procedures for when the internal memory is erased. For most analyzers, nothing special is required as the firmware can detect what analyzer it's running in. However, there are a couple of cases where this doesn't work and manual intervention is required. First, there is apparently no detectable difference between the 8595E and the 8596E, so the unit will pop up a box and ask. However, the procedure for an 8591C is different: it will initialize as an 8591E, and then the manual asks you to send the analyzer FACTSET 11023,1 to switch it to 8591C.
That's a very pretty looking magic number, there. I wonder if there are any more of those?
So, I bought an EPROM programmer, read out all four EPROMs, pieced them together into one, and opened the shebang up in a hex editor. I searched for FACTSET. I found exactly one hit at address 0007E3E0, in what appeared to be some sort of command data structure. That's not going to do me a whole lot of good, so I converted the magic number 11023 to hex (2B 0F) and searched for that. I got exactly one hit, at address 0001978E. This one appeared to be buried in some instructions as well - more interesting! Off to the disassembler....
Right around that address, we find this very interesting piece of code:
(please note that the comments and names have been added by me, they were not originally in the disassembly!)
ROM:0001974C ; =============== S U B R O U T I N E =======================================
ROM:0001974C
ROM:0001974C ; Attributes: bp-based frame
ROM:0001974C
ROM:0001974C process_factset: ; CODE XREF: j_process_factsetj
ROM:0001974C
ROM:0001974C var_4 = -4
ROM:0001974C arg_0 = 8
ROM:0001974C
ROM:0001974C ; FUNCTION CHUNK AT ROM:0001977A SIZE 00000082 BYTES
ROM:0001974C
ROM:0001974C link a6,#-2
ROM:00019750 move.w d0,(sp)
ROM:00019752 bra.s loc_1977A
ROM:00019752 ; End of function process_factset
ROM:00019752
ROM:00019754
ROM:00019754 ; =============== S U B R O U T I N E =======================================
ROM:00019754
ROM:00019754
ROM:00019754 update_bff6: ; CODE XREF: process_factset+3Cp
ROM:00019754 ; process_factset+4Cp ...
ROM:00019754 btst #0,9(a6)
ROM:0001975A beq.s loc_19768
ROM:0001975C move.w ($FFFFBFF6).w,d6
ROM:00019760 move.w -4(a6),d0
ROM:00019764 bset d0,d6
ROM:00019766 bra.s loc_19774
ROM:00019768 ; ---------------------------------------------------------------------------
ROM:00019768
ROM:00019768 loc_19768: ; CODE XREF: update_bff6+6j
ROM:00019768 move.w ($FFFFBFF6).w,d0
ROM:0001976C move.w -4(a6),d6
ROM:00019770 bclr d6,d0
ROM:00019772 move.w d0,d6
ROM:00019774
ROM:00019774 loc_19774: ; CODE XREF: update_bff6+12j
ROM:00019774 move.w d6,($FFFFBFF6).w
ROM:00019778 rts
ROM:00019778 ; End of function update_bff6
ROM:00019778
ROM:0001977A ; ---------------------------------------------------------------------------
ROM:0001977A ; START OF FUNCTION CHUNK FOR process_factset
ROM:0001977A
ROM:0001977A loc_1977A: ; CODE XREF: process_factset+6j
ROM:0001977A subq.l #2,sp
ROM:0001977C cmp.w #$3421,d0
ROM:00019780 bne.s loc_1978C
ROM:00019782 move.w #$A,var_4(a6)
ROM:00019788 bsr.s update_bff6
ROM:0001978A bra.s loc_197F4
ROM:0001978C ; ---------------------------------------------------------------------------
ROM:0001978C
ROM:0001978C loc_1978C: ; CODE XREF: process_factset+34j
ROM:0001978C cmp.w #$2B0F,d0
ROM:00019790 bne.s loc_1979C
ROM:00019792 move.w #9,var_4(a6)
ROM:00019798 bsr.s update_bff6
ROM:0001979A bra.s loc_197F4
ROM:0001979C ; ---------------------------------------------------------------------------
ROM:0001979C
ROM:0001979C loc_1979C: ; CODE XREF: process_factset+44j
ROM:0001979C cmp.w #$2B44,d0
ROM:000197A0 bne.s loc_197AC
ROM:000197A2 move.w #$E,var_4(a6)
ROM:000197A8 bsr.s update_bff6
ROM:000197AA bra.s loc_197F4
ROM:000197AC ; ---------------------------------------------------------------------------
ROM:000197AC
ROM:000197AC loc_197AC: ; CODE XREF: process_factset+54j
ROM:000197AC cmp.w #$30E,d0
ROM:000197B0 bne.s loc_197BA
ROM:000197B2 move.w arg_0(a6),($FFFF9FBC).w
ROM:000197B8 bra.s loc_197F4
ROM:000197BA ; ---------------------------------------------------------------------------
ROM:000197BA
ROM:000197BA loc_197BA: ; CODE XREF: process_factset+64j
ROM:000197BA cmp.w #$30F,d0
ROM:000197BE bne.s loc_197C8
ROM:000197C0 move.w arg_0(a6),($FFFF9FBE).w
ROM:000197C6 bra.s loc_197F4
ROM:000197C8 ; ---------------------------------------------------------------------------
ROM:000197C8
ROM:000197C8 loc_197C8: ; CODE XREF: process_factset+72j
ROM:000197C8 cmp.w #$310,d0
ROM:000197CC bne.s loc_197D6
ROM:000197CE move.w arg_0(a6),($FFFF9FC0).w
ROM:000197D4 bra.s loc_197F4
ROM:000197D6 ; ---------------------------------------------------------------------------
ROM:000197D6
ROM:000197D6 loc_197D6: ; CODE XREF: process_factset+80j
ROM:000197D6 cmp.w #$311,d0
ROM:000197DA bne.s loc_197E4
ROM:000197DC move.w arg_0(a6),($FFFF9FC2).w
ROM:000197E2 bra.s loc_197F4
ROM:000197E4 ; ---------------------------------------------------------------------------
ROM:000197E4
ROM:000197E4 loc_197E4: ; CODE XREF: process_factset+8Ej
ROM:000197E4 cmp.w #$44,d0 ; 'D'
ROM:000197E8 bne.s loc_197F4
ROM:000197EA move.w #6,var_4(a6)
ROM:000197F0 bsr.w update_bff6
ROM:000197F4
ROM:000197F4 loc_197F4: ; CODE XREF: process_factset+3Ej
ROM:000197F4 ; process_factset+4Ej ...
ROM:000197F4 unlk a6
ROM:000197F6 movea.l (sp)+,a0
ROM:000197F8 addq.l #2,sp
ROM:000197FA jmp (a0)
ROM:000197FA ; END OF FUNCTION CHUNK FOR process_factset
This code appears to take two arguments, where one is compared with several 'magic numbers' and the other is then either compared with zero to set/clear a bit or is directly written to a memory location. After some experimentation, it became clear that this code is definitely called by the factset command somehow. This is what these magic numbers do:
FACTSET 13345,1 sets a bit in NVRAM with unknown effect
FACTSET 11023,1 sets the analyzer to C series
FACTSET 11076,1 sets the analyzer to L series
FACTSET 782,n sets the FM demod zero to n
FACTSET 783,n sets the FM demod slope to n
FACTSET 784,n sets the FM demod narrow bw setting to n
FACTSET 785,n sets the FM demod wide bw setting to n
FACTSET 68,1 sets a bit in NVRAM with unknown effect
The memory addresses that 782-785 write to correspond with NVRAM registers for the FM demodulator. I do not know why FACTSET can access them, I presume it is for calibration or debugging, but these commands do not appear in the calibration guide. Searching on the addresses eventually yielded the corresponding strings where the values are displayed in the 'cal data' screens. Two of the bits that FACTSET can change in location FFFFBFF6 have unknown functions, while two of them change the analyzer to C or L series.
None of this has anything to do with the gate module, though! Or does it? Hmm....
Next step is to search for what is displayed when the gate is enabled - "GATE rev B". I found this in the middle of a string table:
ROM:0002B50A aHpib: dc.b 4,'HPIB' ; DATA XREF: ROM:00027A96o
ROM:0002B50F dc.b $20
ROM:0002B510 aRs232: dc.b 5,'RS232' ; DATA XREF: ROM:00027A9Ao
ROM:0002B516 aOven: dc.b 4,'OVEN' ; DATA XREF: ROM:off_27A9Eo
ROM:0002B51B dc.b $20
ROM:0002B51C aFadc: dc.b 4,'FADC' ; DATA XREF: ROM:off_27AA2o
ROM:0002B521 dc.b $20
ROM:0002B522 aOcsl: dc.b 4,'OCSL' ; DATA XREF: ROM:00027AAAo
ROM:0002B527 dc.b $20
ROM:0002B528 aDrts: dc.b 4,'DRTS' ; DATA XREF: ROM:00027AAEo
ROM:0002B52D dc.b $20
ROM:0002B52E aFmd: dc.b 3,'FMD' ; DATA XREF: ROM:00027AB2o
ROM:0002B532 aIo: dc.b 2,'IO' ; DATA XREF: ROM:00027AB6o
ROM:0002B535 dc.b $20
ROM:0002B536 aBands: dc.b 5,'BANDS' ; DATA XREF: ROM:00027ABAo
ROM:0002B53C aGate: dc.b 4,'GATE' ; DATA XREF: ROM:00027ABEo
ROM:0002B541 dc.b $20
ROM:0002B542 aNbw: dc.b 3,'NBW' ; DATA XREF: ROM:off_27AC2o
ROM:0002B546 aNoise: dc.b 5,'NOISE' ; DATA XREF: ROM:off_27AC6o
ROM:0002B54C aRfps: dc.b 4,'RFPS' ; DATA XREF: ROM:00027ACAo
ROM:0002B551 dc.b $20
ROM:0002B552 aDdfadc: dc.b 6,'DDFADC' ; DATA XREF: ROM:00027ACEo
ROM:0002B559 dc.b $20
ROM:0002B55A aTgatten: dc.b 7,'TGATTEN' ; DATA XREF: ROM:00027AD2o
ROM:0002B562 aFast: dc.b 4,'FAST' ; DATA XREF: ROM:00027AD6o
ROM:0002B567 dc.b $20
ROM:0002B568 aTvtun: dc.b 5,'TVTUN' ; DATA XREF: ROM:off_27ADAo
ROM:0002B56E aAtv: dc.b 3,'ATV' ; DATA XREF: ROM:00027ADEo
ROM:0002B572 aCage: dc.b 4,'CAGE' ; DATA XREF: ROM:00027AE2o
ROM:0002B577 dc.b $20
ROM:0002B578 aFrqext: dc.b 6,'FRQEXT' ; DATA XREF: ROM:off_27AE6o
ROM:0002B57F dc.b $20
ROM:0002B580 aLoOutput: dc.b 9,'LO OUTPUT' ; DATA XREF: ROM:off_27AEAo
ROM:0002B58A aComb_0: dc.b 4,'COMB' ; DATA XREF: ROM:00027AEEo
ROM:0002B58F dc.b $20
ROM:0002B590 aGrdly: dc.b 5,'GRDLY' ; DATA XREF: ROM:off_27AF2o
ROM:0002B596 aGatea: dc.b 5,'GATEA' ; DATA XREF: ROM:off_27AF6o
ROM:0002B59C aGateb: dc.b 5,'GATEB' ; DATA XREF: ROM:off_27AFAo
ROM:0002B5A2 aNbwcount: dc.b 8,'NBWCOUNT' ; DATA XREF: ROM:00027AFEo
ROM:0002B5AB dc.b $20
ROM:0002B5AC aProto: dc.b 5,'PROTO' ; DATA XREF: ROM:00027B02o
ROM:0002B5B2 aUfp: dc.b 3,'UFP' ; DATA XREF: ROM:off_27B06o
ROM:0002B5B2 ; ROM:000281A4o
ROM:0002B5B6 aDdfw: dc.b 4,'DDFW' ; DATA XREF: ROM:00027B0Ao
ROM:0002B5BB dc.b $20
ROM:0002B5BC aDdfwrev: dc.b 7,'DDFWREV' ; DATA XREF: ROM:00027B0Eo
ROM:0002B5C4 aDect: dc.b 4,'DECT' ; DATA XREF: ROM:00027B12o
ROM:0002B5C9 dc.b $20
ROM:0002B5CA aUfpa: dc.b 4,'UFPA' ; DATA XREF: ROM:off_27B16o
ROM:0002B5CF dc.b $20
ROM:0002B5D0 aParallel: dc.b 8,'PARALLEL' ; DATA XREF: ROM:off_27B1Ao
ROM:0002B5D9 dc.b $20
ROM:0002B5DA aHpiba: dc.b 5,'HPIBA' ; DATA XREF: ROM:00027B1Eo
ROM:0002B5E0 aHpibb: dc.b 5,'HPIBB' ; DATA XREF: ROM:00027B22o
ROM:0002B5E6 aRs232a: dc.b 6,'RS232A' ; DATA XREF: ROM:00027B26o
ROM:0002B5ED dc.b $20
ROM:0002B5EE aRs232b: dc.b 6,'RS232B' ; DATA XREF: ROM:00027B2Ao
ROM:0002B5F5 dc.b $20
ROM:0002B5F6 aTvpict: dc.b 6,'TVPICT' ; DATA XREF: ROM:off_27B2Eo
ROM:0002B5FD dc.b $20
ROM:0002B5FE asc_2B5FE: dc.b 2,': ' ; DATA XREF: sub_27F62+4Ao
ROM:0002B601 dc.b $20
ROM:0002B602 aDemodTv: dc.b 8,'DEMOD/TV' ; DATA XREF: ROM:00028046o
ROM:0002B60B dc.b $20
ROM:0002B60C aDemodQpd: dc.b 9,'DEMOD/QPD' ; DATA XREF: ROM:00028068o
ROM:0002B616 aGateRevA: dc.b $A ; DATA XREF: ROM:0002808Ao
ROM:0002B616 dc.b 'GATE Rev A'
ROM:0002B621 dc.b $20
ROM:0002B622 aGateRevB: dc.b $A ; DATA XREF: ROM:000280ACo
ROM:0002B622 ; ROM:00028280o
ROM:0002B622 dc.b 'GATE Rev B'
ROM:0002B62D dc.b $20
ROM:0002B62E aGroupDelay: dc.b $B,'GROUP DELAY' ; DATA XREF: ROM:000280F6o
ROM:0002B63A aDdFadc: dc.b 7,'DD/FADC' ; DATA XREF: ROM:0002815Ao
ROM:0002B642 aDdfwRev: dc.b 9,'DDFW rev ' ; DATA XREF: ROM:0002816Ao
ROM:0002B64C aUfpA: dc.b 5,'UFP A' ; DATA XREF: ROM:000281CAo
ROM:0002B652 aTvPicture: dc.b $A ; DATA XREF: ROM:000281F0o
ROM:0002B652 dc.b 'TV Picture'
ROM:0002B65D dc.b $20
ROM:0002B65E aDeleteCnt: dc.b $A ; DATA XREF: ROM:0002825Eo
ROM:0002B65E dc.b 'Delete CNT'
ROM:0002B669 dc.b $20
ROM:0002B66A unk_2B66A: dc.b 3 ; DATA XREF: ROM:00028298o
ROM:0002B66B dc.b $37 ; 7
ROM:0002B66C dc.b $35 ; 5
ROM:0002B66D dc.b $FA ;
ROM:0002B66E aDectSource: dc.b $B,'DECT Source' ; DATA XREF: ROM:000282F0o
ROM:0002B67A aHpibParallel: dc.b $F,'HPIB + Parallel' ; DATA XREF: ROM:0002835Eo
ROM:0002B68A aRs232Parallel: dc.b $10,'RS232 + Parallel' ; DATA XREF: ROM:00028374o
ROM:0002B69B dc.b $20
(continued...)