You are on page 1of 20

; RENU CPU PROM for BEEPS-T ver 1.116 ; based on ; Cascades2 CPU PROM for BEEPS-T ver 1.

104 ; based on ; Scifer2 CPU PROM for BEEPS-T ver 1.102 ; based on ; ROPA K21 CPU PROM for HEEPS-I ver 0.089 ; ;Cascades2 Bp and BO soldered in flight versions are v1.102 ;Scifer2 Bp and BO soldered in flight versions are v1.101 ;directives moved to front to make ASEM happy. ;directives added to make MetaLink ASM51.EXE happy: $MOD51 $TITLE(K21 CPU PROM VER: RENU 1.116 for BEEPS-T 40.026) $PAGEWIDTH(132) $NOPAGING $NODEBUG $SYMBOLS $OBJECT ;ASEM will object to this directive, no problem ; scf2_he.asm(19): illegal control statement ; ;RENU Bp and BO v1.116 -- GENERALIZING ECHO handling ;RENU Bp and BO v1.115 -- ECHO as in 112 ; !!! v1.110 -> v1.111 ORG 80H -> ORG 100H withOUT corresponding change in VECH/VECH -- slipstream fix ;RENU Bp and BO v1.114 -- was still watching A1 instead of CTR (SwpRst) now fixed ;RENU Bp and BO v1.113 -- got 32 seconds between pulses for HT, 1/2 second long pulse due to decrementing on both set and reset, ; decrement on reset now commented out ;RENU Bp and BO v1.112 -- Sweep Step echo in Bin 15 option second round ;RENU Bp and BO v1.111 -- Sweep Step echo in Bin 15 option ;RENU Bp and BO v1.110 -- using CTR instead of A0/A1 for master/slave sweep synch stuff ;RENU Bp and BO v1.109 -- continuing master/slave sweep synch stuff ;RENU Bp and BO v1.108 -- continue adding 1PPS sweep synch stuff and continuing master/slave sweep synch stuff ;RENU Bp and BO v1.107 -- adding 1PPS sweep synch stuff and continuing master/slave sweep synch stuff ;RENU Bp and BO v1.106 -- adding sweep synchronizization code using P3.1 (A0) & P3.2 (A1) to communicate ;RENU Bp and BO v1.105 -- updating sweep data in comments ;Cascades2 Bp and BO v1.104 -- added parasync to end tags v1.104 ;Cascades2 Bp and BO start versions are v1.103 -- same as Scifer2 v1.102 ; v1.102 moves data above ALL register sets ;Scifer2 Bp and BO soldered in flight versions are v1.101 ; v1.101 moves ORing and ANDing to make sure that bit 6 is set and bit 7 is not set even when no shifting is done ; v1.100 adds ANDing and ORing to make sure that bit 6 is set and bit 7 is not set when shifting is done ; v1.099 adds bin number right shifting for 16 or 32 bins -- no hardware changes needed for differing numbers of bins ; v1.098 can be assembled with ASM51 or ASEM_51 to get identical .HEX results

; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

the HEXBIN.EXE from ASEM will FF pad rather than 00 pad, otherwise .BINs are the same v1.097 adds stepping energy on every fourth set of bins (Nth in general) v1.096 adds 16/20 and 32/40 padding options v1.095 adds stepping energy on every other set of bins v0.89 is the same as v0.86 (with FAST_OUT on) which is what went to Wallops for the ROPA Pre-Integration and gave apparently good data v0.87 added the SKIP_ONE and SKIP_TWO which HEI needed, but apparently screw up HII (or the implementation foo-ed something) so 0.87 and 0.88 are sidelined and we revert to 0.86 renumbered to 0.89 based on K21 CPU PROM VER: Cascades 0.81 for HEEPS-I detector derived from K21 PROM VER: Sersio 0.74 for HEEPS-M detector for ROPA Box 1 Tray 3 K21 CPU based on Cascades & Sersio sources which were based on SIERRA K21 source from Mark Widholm, modified to assemble with ASM51.EXE from MetaLink original Sierra code used 12 HMz processor & crystal now running on 24 MHz processor and crystal steps time 64 64 32 64 64 (64) steps time 32 64 32 64 (64) sweep 128ms 128ms 64ms 128ms 256ms 256ms sweep 64ms 128ms 64ms 128ms 128ms based on K21 - prog 0 K21 - new prog 1 K21 - new prog 3 K21 - prog 2 modified K20 - prog 2 modified (sweep generated for BEEPS p is shared by BEEPS O) K21 K21 K21 K21 K21 K20 - new prog 1 - new prog 1 - new prog 3 - prog 0 - prog 2 modified - prog 2 modified (sweep generated for BEEPS p is shared by BEEPS O)

;SERSIO values: ;detector readout angle step ; rate bins time ;HEEPS T1 32K 64 2ms ;HEEPS T2 32K 64 2ms ;HEEPS M 32K 64 2ms ;HEEPS E 16K 32 2ms ;BEEPS p 4K 16 4ms ;BEEPS O 4K 16 4ms ;Scifer2 values: ;detector readout angle step ; rate bins time ;HEEPS E 32K* 32 2ms ;HEEPS T 32K 64 2ms ;HEEPS M 32K 64 2ms ;BEEPS p 32K** 16 2ms ;BEEPS O 32K** 16 2ms ;* oversampled x2 ;** oversampled x4 ;RENU values: ;detector readout angle step ; rate bins time ;HEEPS E 32K* 32 2ms

steps time 32

sweep 64ms based on K21 prog 0

;HEEPS T 32K 64 ;HEEPS M 32K 64 ;BEEPS p 16K** 16 ;BEEPS O 16K** 16 ;* oversampled x2 ;** oversampled x2 (or not OVERSAMPLE EQU 1 ;OVERSAMPLE EQU SAMPLE EQU 2 ;** OVERSAMPLED X2 ECHO ;ECHO EQU 1 EQU 0 0

2ms 2ms 2ms 2ms

64 32 64 (64)

128ms 64ms 128ms 128ms

K21 K21 K21 K20

- new prog 1 - new prog 3 - prog 2 modified - prog 2 modified (sweep generated for BEEPS p is shared by BEEPS O)

oversampled)

;DOSYNCH SET 0 DOSYNCH SET 1 IF (DOSYNCH) MASTER SET 0 ;MASTER SET 1 ;SLAVE SET 0 SLAVE SET 1 SYNC1PPS SET 0 ;don't force energy sweep to reset at 1PPS ELSE ;IF (DOSYNCH) MASTER SET 0 SLAVE SET 0 ENDIF ;IF (DOSYNCH) ;SYNC1PPS SET 1 ;force energy sweep to reset at 1PPS SYNC1PPS SET 0 ;don't force energy sweep to reset at 1PPS IF (SYNC1PPS) DOSYNCH SET 0 MASTER SET 0 SLAVE SET 0 ENDIF ;IF (SYNC1PPS) IF (DOSYNCH) IF (MASTER) SLAVE SET 0 ELSE ;IF (MASTER) MASTER SET 0 ENDIF ;IF (MASTER) IF (SLAVE) MSCOUNT EQU ELSE ;IF (SLAVE) MSCOUNT EQU

1 16

;v1.108 -> v1.109 ;v1.108 -> v1.109

ENDIF ;IF (SLAVE) ENDIF ;IF (DOSYNCH) OLDSTYLE SET 1 NEWSTYLE SET 0 ;OLDSTYLE SET 0 ;NEWSTYLE SET 1 IF (OLDSTYLE) NEWSTYLE SET 0 ELSE ;IF (OLDSTYLE) IF (NEWSTYLE) ELSE ;IF (NEWSTYLE) OLDSTYLE SET 1 ;IF NEITHER IS SET, SET OLDSTYLE ON ENDIF ;IF (NEWSTYLE) ENDIF ;IF (OLDSTYLE) ;SKIP_ONE EQU 1 ;on RESET skip one word out SKIP_ONE EQU 0 ;on RESET skip one word out ;SKIP_TWO EQU 1 ;on RESET skip two words out SKIP_TWO EQU 0 ;on RESET skip two words out ;; IF 64 BINS ;TWO6 EQU 64 ;TWO5 EQU 0 ;TWO4 EQU 0 ;;ELSE IF 32 BINS ;TWO6 EQU 0 ;TWO5 EQU 32 ;TWO4 EQU 0 ;ELSE IF 16 BINS TWO6 EQU 0 TWO5 EQU 0 TWO4 EQU 16 ;ENDIF ;PAD EQU 1 PAD EQU 0 ;detector readout angle step ; rate bins time ;BEEPS T 32K 16 2ms** ;** oversampled x4 steps time 64 sweep 128ms based on ROPA HI & Sersio BT

FAST_OUT EQU 1 ;probably keep on for flight ;FAST_OUT EQU 0 ;PARANOID EQU 1 ;probably turn off for flight

;;PARANOID EQU 0 ;;METANOID EQU 1 ;METANOID EQU 0 PARANOID EQU 0 USING ; ; ; ; ; 0

;definitely turn off for flight

;Select addresses for Bank 0

PORT USAGE P0 FIFO output P1 BNn input P2 DAC output - K21 (not used on K20) P3 single bit IO

; IO BITS TST BIT P3.0 A0 BIT P3.1 A1 BIT P3.2 PPS1 EQU A1 ;INT1 BIT P3.3

CTR BIT P3.4 ;SwpRst EQU A0 SwpRst EQU CTR EVENT BIT P3.5 ;WR BIT P3.6 ;LOAD FIFO ACK BIT P3.7 ; the AD-7111A can only sweep down when presented ; an ascending count, so the count must be provided as a count down to get an ; upward sweep with the AD-7111A ; ;tailored sweep information ;HEEPS-T sweep simulation program SWEEPT.FOR ; khi = 2.3? 2.7? DETECTOR FACTOR ; hv = 1.0 HV BOARD AMPLIFICATION FACTOR ; board = 1.0 K21 BOARD DE-AMPLIFICATION FACTOR ; numsteps = 64 RESTART_HT EQU 198 ;195 - -3 == START_HT - INC_HT START_HT EQU 195 INC_HT EQU -3 LAST_HT EQU 6 END_HT EQU LAST_HT + INC_HT ;;;Sersio HT sweep ;;;HEEPS-T1, HEEPS-T2, BEEPS-T sweep simulation program SWEEPT.FOR

;;; kht1 = 7.3 DETECTOR FACTOR ;;; hv = 1.0 NO HV BOARD AMPLIFICATION ;;; board = 3.5 K21 BOARD DE-AMPLIFICATION FACTOR ;;; numsteps = 64 ;;START_HT1 EQU 131 ;;INC_HT1 EQU -2 ;;LAST_HT1 EQU 5 ;;END_HT1 EQU 3 ;5 + -2 ;INTERNAL RAM ;directive added to make MetaLink ASM51.EXE happy: DSEG ;directly addressable Data memory SEGment definition ; ORG 8H ;1.101 -> 1.102 ORG 20H ;skip over register banks 0..3 SWP: DS 1 ;SWEEP STEP NUMBER VECL: DS 1 VECH: DS 1 DS 8 IGNORE: DS 3 FLAG EQU R7 ;1.101 -> 1.102

IF (OVERSAMPLE) SKIP: DS 1 ENDIF ;IF (OVERSAMPLE) IF (DOSYNCH) MSCOUNTER: DS 1 ;v1.108 -> v1.109 ENDIF ;IF (DOSYNCH) ORG BIN0: BIN1: BIN15: BIN16: BIN19: BIN20: BIN31: BIN32: BIN39: BIN40: BIN63: BIN64: 40H ;IMAGE BINS. MUST BE AT 40H FOR HARDWARE DS 1 DS 14 DS 1 DS 3 DS 1 DS 11 DS 1 DS 7 DS 1 DS 23 DS 1 DS 0

IF (TWO6) LASTBIN EQU BIN63 ELSE IF (TWO5) IF (PAD) LASTBIN EQU BIN39 ELSE ;IF (PAD) LASTBIN EQU BIN31 ENDIF ;IF (PAD) ELSE IF (TWO4) IF (PAD) LASTBIN EQU BIN19 ELSE ;IF (PAD) LASTBIN EQU BIN15 ENDIF ;IF (PAD) ENDIF ;IF (TWO4) ENDIF ;IF (TWO5) ENDIF ;IF (TWO6) ;directive added to make MetaLink ASM51.EXE happy: CSEG ;code memory SEGment definition ORG 0 JMP RESET_ ;1us JUMP AROUND INTR HANDLER ; --------------------------------ORG 13H ; External INT 1 vectors to here, so each external INT 1 will jump via this ; dispatch code to the appropriate PROGn INTV1: MOV SP,#VECH ;1us JUMP INDIRECT THRU VEC BY LOADING SP RETI ;1us AND DOING A RET ; --------------------------------; RESET HAPPENS ONLY ON POWER UP (OR ATTEMPT TO READ EMPTY FIFO) RESET_: ;; IF (FAST_OUT) ; write out data to FIFO a.s.a.p. ; CLR A MOVX @R0,A ;WRITE 0 TO FIFO BIN0 (ADDR NOT USED) MOV R0,#BIN0 ;----------------------------------- SET DATA TO TEST RAMP and output test ramp

LPRESET: MOV @R0,A INC R0 IF (TWO6) ADD A,#3 ELSE IF (TWO5) ADD A,#7 ELSE IF (TWO4) ADD A,#15 ENDIF ;IF (TWO4) ENDIF ;IF (TWO5) ENDIF ;IF (TWO6) MOVX @R0,A ;WRITE TEST VALUE TO FIFO BIN?? (ADDR NOT USED) 64 BINS

IF (TWO6) CJNE R0,#BIN64,LPRESET ;LOOP FOR ELSE IF (TWO5) IF (PAD) CJNE R0,#BIN40,LPRESET ;LOOP FOR ELSE ;IF (PAD) CJNE R0,#BIN32,LPRESET ;LOOP FOR ENDIF ;IF (PAD) ELSE ;IF (TWO5) IF (TWO4) IF (PAD) CJNE R0,#BIN20,LPRESET ;LOOP FOR ELSE ;IF (PAD) CJNE R0,#BIN16,LPRESET ;LOOP FOR ENDIF ;IF (PAD) ENDIF ;IF (TWO4) ENDIF ;IF (TWO5) ENDIF ;IF (TWO6) ;-----------------------------------

40 BINS 32 BINS

20 BINS 16 BINS

END -- SET DATA TO TEST RAMP

; now that FIFO is filled, do rest of initialization ENDIF ;IF (FAST_OUT) ;; MOV TCON,#04H ; MOV SWP,#START_HT ;RESET VALUE ;1us EDGE TRIG FOR INT1

IF (DOSYNCH) IF (MASTER) SETB A0 ;TOGGLE SYNCH BIT -- GOES ON HERE, OFF LATER ENDIF ;IF (MASTER) ENDIF ;IF (DOSYNCH) MOV FLAG,#0 ; MOV VECH,#00H ; MOV VECL,#80H ;1us 80H LEAVES ROOM FOR RESET CODE ; !!! v1.110 -> v1.111 ORG 80H -> ORG 100H withOUT corresponding change in VECH/VECH -- slipstream fix MOV VECH,#01H MOV VECL,#00H ;1us 100H LEAVES ROOM FOR RESET CODE MOV SP,#IGNORE ;1us PLACE TO PUT PC IF INTERUPTED MOV R0,#BIN0 CLR A IF (OVERSAMPLE) MOV SKIP,#SAMPLE ENDIF ;IF (OVERSAMPLE) IF (DOSYNCH) MOV MSCOUNTER,#MSCOUNT ENDIF ;IF (DOSYNCH) IF (SYNC1PPS) CLR SwpRst ENDIF ;IF (SYNC1PPS) ;----------------------------------- SET DATA TO TEST RAMP LPRESET2: MOV @R0,A INC R0 IF (TWO6) ADD A,#3 ELSE IF (TWO5) ADD A,#7 ELSE IF (TWO4) ADD A,#15 ENDIF ;IF (TWO4) ENDIF ;IF (TWO5) ENDIF ;IF (TWO6) ;v1.108 -> v1.109

IF (TWO6) CJNE R0,#BIN64,LPRESET2 ;LOOP FOR 64 BINS ELSE ;IF (TWO6) IF (TWO5) IF (PAD) CJNE R0,#BIN40,LPRESET2 ;LOOP FOR 40 BINS ELSE ;IF (PAD) CJNE R0,#BIN32,LPRESET2 ;LOOP FOR 32 BINS ENDIF ;IF (PAD) ELSE ;IF (TWO5) IF (TWO4) IF (PAD) CJNE R0,#BIN20,LPRESET2 ;LOOP FOR 20 BINS ELSE ;IF (PAD) CJNE R0,#BIN16,LPRESET2 ;LOOP FOR 16 BINS ENDIF ;IF (PAD) ENDIF ;IF (TWO4) ENDIF ;IF (TWO5) ENDIF ;IF (TWO6) ;----------------------------------- END -- SET DATA TO TEST RAMP IF (DOSYNCH) IF (MASTER) CLR A0 ;TOGGLE SYNCH BIT -- GOES OFF HERE, ON EARLIER ENDIF ;IF (MASTER) ENDIF ;IF (DOSYNCH) MOV IE,#84H ;1us ENABLE EXT INT1 JMP INTV1 ;1us JMP PROG0 ;1us ;why not just jump to PROG0?

Does the RETI @

;------------------------------------------------------; EVENT WAIT LOOP (USED BY ALL PROGS) IF (SYNC1PPS) SWEEPSYNC: CJNE FLAG,#0,WT_FOO SETB SwpRst MOV SWP,#RESTART_HT ;RESET VALUE MOV FLAG,#255 CLR SwpRst JMP WT_FOO ENDIF ;IF (SYNC1PPS) IF (DOSYNCH)

IF (SLAVE) SWEEPSYNC: CJNE FLAG,#0,WT_FOO DJNZ MSCOUNTER,WT_FOO ;v1.108 -> v1.109 MOV SWP,#RESTART_HT ;RESET VALUE MOV FLAG,#255 MOV MSCOUNTER,#MSCOUNT ;v1.108 -> v1.109 JMP WT_FOO ENDIF ;IF (SLAVE) ENDIF ;IF (DOSYNCH) OK: INC @R0 ;1/2us COUNT EVENT WT: IF (SYNC1PPS) JB PPS1,SWEEPSYNC MOV FLAG,#0 WT_FOO: ENDIF ;IF (SYNC1PPS) IF (DOSYNCH) IF (SLAVE) JB SwpRst,SWEEPSYNC MOV FLAG,#0 WT_FOO: ENDIF ;IF (SLAVE) ENDIF ;IF (DOSYNCH)

;v1.113 -> v1.114

A1 ->

SwpRst

JNB EVENT,WT ;1us WAIT FOR: NEXT EVENT OR INTR MOV A,P1 ;GET BIN # INTO A IF (OLDSTYLE) CLR ACK ;1/2us PULSE ACK- TO ENABLE NEXT EVENT ENDIF ;IF (OLDSTYLE) ;; The AND and the OR following prevent unused input bits from being seen. While hardware should force these bits to proper values, ;; damage to the internal pull-ups of the chips can prevent pins that should be high from being high. ;;IF (METANOID) ;;; ANL A,#7FH ;64 BINS ;anding this bit out prior to setting it is unnecessary ;; ORL A,#40H ;;ENDIF ;IF (METANOID) ; mask out high bits ANL A,#3FH ;1/2us

IF (TWO6) ; do nothing ELSE ;IF (TWO6) IF (TWO5) CLR C ;1/2us RRC A ;1/2us ELSE ; IF (TWO5) IF (TWO4) CLR C ;1/2us RRC A ;1/2us CLR C ;1/2us RRC A ;1/2us ELSE ; IF (TWO4) ; do nothing ENDIF ; IF (TWO4) ENDIF ; IF (TWO5) ENDIF ; IF (TWO6) ORL A,#40H ;1/2us

64 -> 32 mapping shift bin number right 1 bit 64 -> shift 32 -> shift 32 mapping bin number right 1 bit 16 mapping bin number right 1 bit

CLR ACK ;1/2us PULSE ACK- TO ENABLE NEXT EVENT MOV R0,A SETB ACK ;1/2us CJNE @R0,#255,OK ;1us CHECK FOR WRAP JMP WT ;1us IGNORE EVENT IF AT 255 ;------------------------------------------------------ORG 100H ;detector readout angle step steps sweep ; rate bins time time ;HEEPS T 32K 64 2ms 64 128ms K21 - new prog 1 ;START_HT EQU 195 ;INC_HT EQU -3 ;LAST_HT EQU 6 ;END_HT EQU 3 ;3 = 6 + -3 == LAST_HT + INC_HT PROG0: MOV SP,#IGNORE MOV A,BIN0 MOVX @R0,A MOV BIN0,#0 MOV A,SWP MOV P2,A ;PLACE TO PUT PC IF INTERUPTED ;1/2us ;1us WRITE BIN0 TO FIFO (ADDR NOT USED) ;1us CLEAR BIN0 ;OUTPUT SWEEP STEP TO DAC

IF (ECHO) MOV R0,#LASTBIN ;now generalized MOV @R0,A

ENDIF

;IF (ECHO)

; ADD A,#INC_HT IF (OVERSAMPLE) DJNZ SKIP,SKIPIT ADD A,#INC_HT MOV SKIP,#SAMPLE SKIPIT: ELSE ;IF (OVERSAMPLE) ADD A,#INC_HT ENDIF ;IF (OVERSAMPLE) ; ; since this next is an EQUAL compare, and the increment is not required to ; be +1 or -1, the starting value needs to be carefully chosen both for use ; here in restarting the next sweep and initially on RESET ; CJNE A,#END_HT,FOO0 ;otherwise do restart of sweep when end value seen MOV A,#START_HT ;RESET VALUE IF OVERFLOW IF (DOSYNCH) IF (MASTER) DJNZ MSCOUNTER,MS_FOO ;Oh Oh ;v1.108 -> v1.109 SETB A0 ;TOGGLE SYNCH BIT -- GOES ON HERE, OFF LATER MS_FOO: ;Oh Oh ENDIF ;IF (MASTER) ENDIF ;IF (DOSYNCH) FOO0: MOV SWP,A JB TST,TST0 MOV R0,#BIN1 LP0: MOV A,@R0 MOVX @R0,A CLR A MOV @R0,A INC R0 ;UPDATE SWEEP ; go do test ramp if TST bit set ;OUTPUT BINS TO FIFO

;GET BIN ;WRITE TO FIFO. (ADDR NOT USED) ;CLEAR BIN

IF (TWO6) CJNE R0,#BIN64,LP0 ELSE IF (TWO5) IF (PAD) CJNE R0,#BIN40,LP0

;LOOP FOR 64 BINS

;LOOP FOR 40 BINS

ELSE ;IF (PAD) CJNE R0,#BIN32,LP0 ENDIF ;IF (PAD) ELSE IF (TWO4) IF (PAD) CJNE R0,#BIN20,LP0 ELSE ;IF (PAD) CJNE R0,#BIN16,LP0 ENDIF ;IF (PAD) ENDIF ;IF (TWO4) ENDIF ;IF (TWO5) ENDIF ;IF (TWO6)

;LOOP FOR 32 BINS

;LOOP FOR 20 BINS ;LOOP FOR 16 BINS

IF (DOSYNCH) IF (MASTER) ; DJNZ MSCOUNTER,MS_F00 ;Zero Zero ;v1.108 -> v1.109 CLR A0 ;TOGGLE SYNCH BIT -- GOES OFF HERE, ON EARLIER MS_F00: ;Zero Zero ENDIF ;IF (MASTER) ENDIF ;IF (DOSYNCH) SETB ACK JMP WT ; 16/64 ; LOADS TST0: MOV MOV ;MAKE SURE ACK- IS HI

; commented out in v1.113, don't need count in BOTH places

BIN TEST PATTERN GENERATOR. RAMP INTO 16/64 BINS WHEN TST BIT IS HIGH BIN0,#1 R1,#1 ;BIN0 RAMP VALUE ;R1 IS RAMP COUNTER ;OUTPUT BINS TO FIFO ;GET BIN ;WRITE TO FIFO. (ADDR NOT USED) ;SET BIN TO RAMP VALUE

MOV R0,#BIN1 TLP0: MOV A,@R0 MOVX @R0,A MOV A,R1 MOV @R0,A IF (TWO6) ADD A,#3 ELSE IF (TWO5) ADD A,#7 ELSE IF (TWO4) ADD A,#15 ENDIF ;IF (TWO4)

ENDIF ;IF (TWO5) ENDIF ;IF (TWO6) MOV R1,A ;BUMP RAMP BY INCREMENT INC R0 IF (TWO6) CJNE R0,#BIN64,TLP0 ;LOOP FOR 64 BINS ELSE IF (TWO5) IF (PAD) CJNE R0,#BIN40,TLP0 ;LOOP FOR 40 BINS ELSE ;IF (PAD) CJNE R0,#BIN32,TLP0 ;LOOP FOR 32 BINS ENDIF ;IF (PAD) ELSE IF (TWO4) IF (PAD) CJNE R0,#BIN20,TLP0 ;LOOP FOR 20 BINS ELSE ;IF (PAD) CJNE R0,#BIN16,TLP0 ;LOOP FOR 16 BINS ENDIF ;IF (PAD) ENDIF ;IF (TWO4) ENDIF ;IF (TWO5) ENDIF ;IF (TWO6) IF (DOSYNCH) IF (MASTER) ; DJNZ MSCOUNTER,MS_F0O ;Zero Oh ;v1.108 -> v1.109 CLR A0 ;TOGGLE SYNCH BIT -- GOES OFF HERE, ON EARLIER MS_F0O: ;Zero Oh ENDIF ;IF (MASTER) ENDIF ;IF (DOSYNCH) SETB ACK JMP WT ;MAKE SURE ACK- IS HI

; commented out in v1.113, don't need count in BOTH places

;IF (PARANOID) ; JMP RESET ;should never get here, so if we do RESET ;ENDIF ;IF (PARANOID) ;"Step", ;000, ;001, ;002, ;003, ;004, ;005, "N" , 195, 192, 189, 186, 183, 180, "Vout" , "Scaled" -.264808E-02, .264808E-02 -.301426E-02, .301426E-02 -.343108E-02, .343108E-02 -.390554E-02, .390554E-02 -.444561E-02, .444561E-02 -.506036E-02, .506036E-02

;006, ;007, ;008, ;009, ;010, ;011, ;012, ;013, ;014, ;015, ;016, ;017, ;018, ;019, ;020, ;021, ;022, ;023, ;024, ;025, ;026, ;027, ;028, ;029, ;030, ;031, ;032, ;033, ;034, ;035, ;036, ;037, ;038, ;039, ;040, ;041, ;042, ;043, ;044, ;045, ;046, ;047, ;048, ;049, ;050, ;051, ;052,

177, 174, 171, 168, 165, 162, 159, 156, 153, 150, 147, 144, 141, 138, 135, 132, 129, 126, 123, 120, 117, 114, 111, 108, 105, 102, 099, 096, 093, 090, 087, 084, 081, 078, 075, 072, 069, 066, 063, 060, 057, 054, 051, 048, 045, 042, 039,

-.576012E-02, -.655664E-02, -.746331E-02, -.849535E-02, -.967011E-02, -.110073E-01, -.125294E-01, -.142620E-01, -.162342E-01, -.184791E-01, -.210345E-01, -.239431E-01, -.272541E-01, -.310228E-01, -.353127E-01, -.401959E-01, -.457542E-01, -.520812E-01, -.592831E-01, -.674810E-01, -.768124E-01, -.874342E-01, -.995248E-01, -.113287 , -.128953 , -.146785 , -.167083 , -.190187 , -.216487 , -.246423 , -.280499 , -.319287 , -.363439 , -.413696 , -.470903 , -.536020 , -.610142 , -.694514 , -.790554 , -.899873 , -1.02431 , -1.16595 , -1.32718 , -1.51071 , -1.71962 , -1.95741 , -2.22808 ,

.576012E-02 .655664E-02 .746331E-02 .849535E-02 .967011E-02 .110073E-01 .125294E-01 .142620E-01 .162342E-01 .184791E-01 .210345E-01 .239431E-01 .272541E-01 .310228E-01 .353127E-01 .401959E-01 .457542E-01 .520812E-01 .592831E-01 .674810E-01 .768124E-01 .874342E-01 .995248E-01 .113287 .128953 .146785 .167083 .190187 .216487 .246423 .280499 .319287 .363439 .413696 .470903 .536020 .610142 .694514 .790554 .899873 1.02431 1.16595 1.32718 1.51071 1.71962 1.95741 2.22808

;053, ;054, ;055, ;056, ;057, ;058, ;059, ;060, ;061, ;062, ;063,

036, 033, 030, 027, 024, 021, 018, 015, 012, 009, 006,

-2.53619 -2.88690 -3.28610 -3.74051 -4.25776 -4.84653 -5.51672 -6.27959 -7.14795 -8.13638 -9.26150

, , , , , , , , , , ,

2.53619 2.88690 3.28610 3.74051 4.25776 4.84653 5.51672 6.27959 7.14795 8.13638 9.26150

;-----------------------------------------------------------------------;PARASYNC MACRO ;EOC SET ($/16) ;EOC SET (EOC+1)*16 ; ORG EOC ; ENDM ; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC ROM_ID: DB 'K21 CPU PROM VER: RENU 1.116 for BEEPS-T; 40.026; ' ; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC SWEEPDATA: IF (OVERSAMPLE) DB 'BEEPS T 32 K** 16 bins 2 ms/Step 64 Steps DB 'Step energy sweep every SECOND set of bins ' ;** oversampled x2 ELSE DB 'BEEPS T 32 K 16 bins 1/2 ms/Step 64 Steps DB 'Step energy sweep every set of bins ' ENDIF ;IF (OVERSAMPLE) ; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC

128 ms/sweep '

32 ms/sweep '

OPTIONS: IF (FAST_OUT) DB 'Fast_Out; ' ELSE DB 'NO_Fast_Out; ' ENDIF ;IF (FAST_OUT) ; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC IF (ECHO) DB 'Sweep Step Echo in Bin 15; ELSE DB 'NO_Sweep Step Echo; ' ENDIF ;IF (ECHO)

'

; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC IF (SKIP_TWO) DB 'on RESET skip two words out; ' ELSE ;IF (SKIP_TWO) IF (SKIP_ONE) DB 'on RESET skip ONE word out; ' ELSE ;IF (SKIP_ONE) DB 'on RESET DO NOT Skip ANY words out; ENDIF ;IF (SKIP_ONE) ENDIF ;IF (SKIP_TWO) ; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC IF (SYNC1PPS) DB 'force energy sweep to reset at 1PPS; ELSE DB 'NO_SYNC1PPS; ' ENDIF ;IF (SYNC1PPS) ; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC IF (DOSYNCH) IF (MASTER)

'

'

DB 'MASTER: SEND COMMAND TO force energy sweep reset in other 8051s ' DB 'every 16 sweep resets ' ELSE ;IF (MASTER) DB 'SLAVE: SYNC energy sweep on command ' DB 'every time received ' ENDIF ;IF (MASTER) ELSE ; IF (DOSYNCH) DB 'NO Master/Slave SweepSynch; ' ENDIF ;IF (DOSYNCH) ; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC IF (TWO6) DB '64 bins output; ELSE IF (TWO5) IF (PAD) DB '40 bins output; ELSE ;IF (PAD) DB '32 bins output; ENDIF ;IF (PAD) ELSE IF (TWO4) IF (PAD) DB '20 bins output; ELSE ;IF (PAD) DB '16 bins output; ENDIF ;IF (PAD) ENDIF ;IF (TWO4) ENDIF ;IF (TWO5) ENDIF ;IF (TWO6)

'

' '

' '

; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC IF (OLDSTYLE) DB 'OLDSTYLE ack handling; ' ELSE ;IF (OLDSTYLE) IF (NEWSTYLE) DB 'NEWSTYLE ack handling; ' ELSE ;IF (NEWSTYLE) DB 'NOT_OLDSTYLE ack handling; ENDIF ;IF (NEWSTYLE) ENDIF ;IF (OLDSTYLE)

'

; PARASYNC EOC SET ($/16) EOC SET (EOC+1)*16 ORG EOC IF (PARANOID) DB 'PARANOID; ' ELSE DB 'NOT_PARANOID; ENDIF ;IF (PARANOID) END

'

You might also like