Beruflich Dokumente
Kultur Dokumente
89
;
; 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
; 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
; BIT P3.1
; BIT P3.2
;INT1 BIT P3.3
; BIT P3.4 ;COUNTER INPUT (NOT USED)
EVENT BIT P3.5
;WR BIT P3.6 ;LOAD FIFO
ACK BIT P3.7
;INTERNAL RAM
;directive added to make MetaLink ASM51.EXE happy:
DSEG ;directly addressable Data memory SEGment definition
ORG 8H
SWP: DS 1 ;SWEEP STEP NUMBER
VECL: DS 1
VECH: DS 1
DS 8
IGNORE: DS 3
; ---------------------------------
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
; ---------------------------------
MOV R0,#BIN0
CLR A
OK:
INC @R0 ;1/2us COUNT EVENT
WT:
JNB EVENT,WT ;1us WAIT FOR: NEXT EVENT OR INTR
MOV A,P1 ;GET BIN # INTO A
CLR ACK ;1/2us PULSE ACK- TO ENABLE NEXT EVENT
;; 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)
MOV R0,A
SETB ACK ;1/2us
CJNE @R0,#255,OK ;1us CHECK FOR WRAP
JMP WT ;1us IGNORE EVENT IF AT 255
;-------------------------------------------------------
ORG 80H
;detector readout angle step steps sweep
; rate bins time time
;HEEPS M 32K 64 2ms 32 64ms K21 - now prog 0
; HEEPS-M: K63 & K6 (K21_6) for detection; K2 (K4_2) for bias and sweep; K21 (K21_6) generates sweep signal for input
into K2 (K4_2)
; HEEPS-M: 64 bins; 7 - 800 eV
;START_HM EQU 154
;INC_HM EQU -4
;END_HM EQU 26 ;30 + -4 == LAST_HM + INC_HM
PROG0:
MOV SP,#IGNORE ;PLACE TO PUT PC IF INTERUPTED
MOV A,BIN0 ;1/2us
MOVX @R0,A ;1us WRITE BIN0 TO FIFO (ADDR NOT USED)
MOV BIN0,#0 ;1us CLEAR BIN0
MOV A,SWP
MOV P2,A ;OUTPUT SWEEP STEP TO DAC
ADD A,#INC_HI
;
; 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_HI,FOO0 ;otherwise do restart of sweep when end value seen
MOV A,#START_HI ;RESET VALUE IF OVERFLOW
FOO0:
MOV SWP,A ;UPDATE SWEEP
JB TST,TST0 ; go do test ramp if TST bit set
;IF (PARANOID)
; JMP RESET ;should never get here, so if we do RESET
;ENDIF ;IF (PARANOID)
END