;================================================================ ; DEP_SS.DPS ; ; Sequence to test List processing instrcutions ; (This version is currently built into DFC1002) ; ; V2.00 22 Mar 95 Dnyanesh Mathur ; 1. Moved the command to set frame exposure after the call ; to DFRM (decode frame) in the OBSPROC section. This ; enables each frame to use different exposures. ; 2. Frame numbers count from 1 to 20, rather than 0 to 19. ; ; V3.00 10 Apr 95 Dnyanesh Mathur ; 1. Changed the frame number count range to 1-20 instead of ; 0 - 19. ; ; V4.00 22 May 95 Dnyanesh Mathur ; 1. Register R16 - R25 have been re-assigned to make control ; information available in HK telemetry. (Registers 0-27 ; are downlinked in HK). ; 2. The ALT cadence is used as the interval between the start ; of the ALT observation. (V3 used ALT Cadence + ALT Repeat ; count as the interval). ; ; ; V5.00 31 May 95 Dnyanesh Mathur *unreleased* ; 1. Clear Chain flag when chain campaign is initiated. ; ; V6.00 8 Nov 95 Dnyanesh Mathur ; 1. Ignore CAL and PAW positions specified in OBS header. ; 2. Set CAL positions specified on a frame AFTER the MTM ; and PAW configure. (Otherwise teh CAL wheels are in ; motion during the previous exposure). ; ; V1.07 16 Nov 95 Dnyanesh Mathur ; 1. Fix bug in ALT cadence. At present the actual cadence is ; cadence+ALT repeats. ; 2. Allow a different cadence to be used during campaigns. ; ; V1.10 21 Dec 95 Dnyanesh Mathur ; 1. Fixed dark frame code. Previously the "dafault" type was ; in case of dark frames. ; ; V1.11 5 Jan 96 Dnyanesh Mathur ; 1. The direction of motion for CAL wheels is not computed ; correctly by the DFRM instruction. Code added here to ; determine direction independently. ; ; V1.12 31 Jan 96 Dnyanesh Mathur ; 1. Remove campaign, New campaign and II campaign initialization ; ; V1.13 14 Feb 96 Dnyanesh Mathur ; 1. Device configuration step is skipped for "null" frames. ; A configure which is not followed by take picture command ; can cause a double exposure. ; ;---------------------------------------------------------------- ; ; Register Usage: ; ; ; Regsiter Usage: ; dpm 19 May 95 ; ; Range Usage ; 0-7 IP-DEP Communication ; 8-15 Main Sequence Parameters ; 16-23 DEP Flags ; 24-31 SCR implicit operands ; 32-47 SCR List Processing Instructions ; 48-63 Normal Sequence Table ; 64-72 Main Sequence Control Flags ; ; ; IP_DEP Commnunications Registers: ; ; Register # Usage ; R0 Frame Number ; R1 Ticks w.r.t. Reference Time ; R2 Cycle # (Interval Count) ; R3 Telemetry Virtual Channel ; R4 ; R5 Dynamics ; R6-R7 Offset ; ; R8 # Observations performed ; R9 Current observation repeat count ; R10 Duration in current mode ; R11 Frame number in current observation ; ; R12-R15 Spare ; ; DEP Flags: ; R16 Standard Sequence Control Flags ; (R64 | R65 << 1 | R66 << 2 | R68 << 3 | R70 << 4 | R72 << 5) ; R17 Prime 60 Address (Copy of R57) ; R18 Prime 30 Address ( R58) ; R19 ALT Address ( R59) ; R20 ALT Repeat Count ( R62) ; R21 ALT Cadence ( R63) ; ; R22 Campaign Address (R67) ; R23 New Campaign Address (R69) ; R24 II Campaign Address (R71) ; R25 Chain Campaign Address (R73) ; ; R26 MTM1 Offset Register ; R27 MTM2 Offset Register ; R28 DMB address auto incr/decr flag ; R29 Hidden DMB Address ; R30 OCB Address auto incr/decr flag ; R31 Hidden OCB Address ; ; Frame List Processing ; R32 Sequence ID (LS word) ; R33 Sequence ID (MS word) ; R34 Time of 1st Frame ; R35 Exposure ; R36 CAL1 Device Fucntion ; R37 CAL1 Position ; R38 CAL2 Device Function ; R39 CAL2 Position ; R40 PAW Device Function ; R41 PAW Position ; R42 CAL Move Flag ; R43 Image Type ; R44 Time ; ; R45 Address of Frame List ; R47 ALT Seq Address (Temporary) ; ; Normal Sequence Table (Load Registers): ; R48 Prime60 Address ; R49 Prime30 Address ; R50 ALT Address ; R51 ALT Header Sequence ; R52 ALT Tail Sequence ; R53 ALT Repeat Count ; R54 ALT Cadence ; ; ALT Observation Control: ; R55 Cycle Time (Cadence + ALT repeat count) ; R56 # ALT repeats remaining ; ; Normal Sequence Table (Working Registers): ; R57 Prime60 Address ; R58 Prime30 Address ; R59 ALT Address ; R60 ALT Header Sequence ; R61 ALT Tail Sequence ; R62 ALT Repeat Count ; R63 ALT Cadence ; ; Control Flags: ; R64 New Prime Table Flag ; R65 ALT Enable Flag ; R66 Campaign Flag ; R67 Campaign List Address ; R68 New List Flag ; R69 New List Address ; R70 II Flag ; R71 II List Address ; R72 Chain List Enable Flag ; R73 Chain List Address ; R74 Campaign ALT Repeat Count ; R75 Campaign ALT Cadence ; ; Miscellaneous Register Usage: ; R81 Campaign Header Seq ; R82 Prime30C ; R83 Campaign Seq ; R84 Campaign Tail Seq ; ; CAL Wheel Control ; R88 Saved CAL1 Position ; R89 Saved CAL2 Position ; ; Registers used by SETDEVDIR routine ; R90 Direction of motion ; R91 New Position ; R92 Old Position ; ; R116 IP Interrupt Code ; R117 IP Interrupt Count ; R118 Intra Instrument Command flag ; R119 Used by Std. Seq. ; R120 Used by Std. Seq. ; R121 ; R122 Sequence Restart Address ; R123 Std. Seq. State ; R124 Epoch ; R125 Hidden IPB address ; ; R248 Observing Interval? ; R249 Interval Counter? ; R250-255 LOBT Time? ; ; ;================================================================ ; LT: .SEQ 0x0000 0xFFFF SET R124 1 ; Set Epoch = 1 ; TOP: SET R12 &PriT LDR R48 R12 ; Address of PRIME60 LDR R49 R12 ; Address of PRIME30 LDR R50 R12 ; Address of ALT Obs LDR R51 R12 ; ALT Header Obs LDR R52 R12 ; ALT Tail Obs LDR R53 R12 ; ALT Repeat Count LDR R54 R12 ; ALT Cadence ; ; LDR R67 R12 ; Campaign List Address ; LDR R69 R12 ; New List Address ; LDR R71 R12 ; II List Address ; CLR R8 ; Set number of observations = 0 CLR R10 ; SRT TIM 16 ; There are 59 sec to next Ref Time ; SIC ; NEW_PRIME: ; Copy Prime List to the working registers CLR R64 ; SET R57 R48 SET R58 R49 SET R59 R50 SET R60 R51 SET R61 R52 SET R62 R53 SET R63 R54 ; SET R55 R63 ; The interval Counter is reset if it ; ADD R55 R62 ;_equals R55 (= Cadence+#Repeats) ; INC R8 ; Increment Observations count CLR R9 ; Initialize observation repeat count CLR R11 ; Initialize Frame counter ; MAINLOOP: CLL &CPYREG 0x0000 ; Copy Working Registers to HK Reg BNZ &NEW_PRIME R64 ; Re-load table if a new prime list available INC R9 ; Increment repeat count GIC R2 BLT &DOPRIME R2 R55 ; Check if interval counter needs to be reset SIC ; DOPRIME: BEQ &LISPROC R66 0x0001 ; Do campaign if flag set ; INC R10 ; Increment duration in mode count ; SET R45 R57 SRT SET R123 0 ; Set Stage Variable CLL &OBSPROC 0x0000 ; Prime60 ; BZ &MAINLOOP R65 ; ALT disabled; repeat prime60 GIC R2 BLT &MAINLOOP R2 R55 ; Time to do ALT? SIC ; R2 >= R55; Reset interval counter ; SET R119 R9 ; Save Prime60 repeat count CLR R9 SET R120 R11 CLR R11 ; SRT SET R45 R60 SET R123 1 ; STAGE = 1 CLL &OBSPROC 0x0000 ; ALT Header ; SET R56 R62 ; Copy ALT repeat count to working reg ALTLOOP: CLL &CPYREG 0x0000 ; Copy Working Registers to HK Reg INC R10 ; Increment duration in mode count SRT SET R45 R58 SET R123 2 ; STAGE = 2 CLL &OBSPROC 0x0000 ; Prime30 BZ &ALTDONE R56 SET R45 R59 SET R123 3 ; STAGE = 3 CLL &OBSPROC 0x0000 ; Alt DEC R56 INC R9 ; Incr ALT Repeat Count UBR &ALTLOOP ; ALTDONE: SET R45 R61 SET R123 4 ; STAGE = 4 CLL &OBSPROC 0x0000 ; Tail ; SET R9 R119 ; Restore Prime60 Repeat Count SET R11 R120 UBR &MAINLOOP ; ;.......................................................... LISPROC: SET R4 1 ; Set Campaign Flag OPNL R81 R67 ; List Header address is in R81 ; SET R14 R62 ; BZ &LISTPROC1 R76 ; Campaign ALT parameters not used ; SET R90 4096 ADD R90 R67 ADD R90 R67 ; Campaign Address is in words. ADD R90 30 LDR R14 R90 ; Campaign ALT repeat count -> R74 BNE &LISPROC1 R14 0xFFFF ; SET R14 R62 ; LISPROC1: SET R55 R63 SRT SET R45 R81 SET R123 8 ; STAGE = 8 CLL &OBSPROC 0x0000 ; Call Header Obs ; SET R10 0xFFFF ; Reset duration in mode flag ; LISTLOOP: CLL &CPYREG 0x0000 ; Copy Working Registers to HK Reg INC R10 ; Increment Mode duration counter GIC R2 GPRI R82 ; R82 = Prime30C BLT &DOPRI30 R2 R55 ; Time to reset Interval Counter? SIC ; DOPRI30: SRT SET R45 R82 SET R123 9 ; STAGE = 9 CLL &OBSPROC 0x0000 ; Do Prime30C Obs ; CHKALT: BZ &CKIIFLG R65 ; ALT Disabled BNZ &DOALTC R56 ; GIC R2 BNE &CKIIFLG R2 R55 ; Not time to call ALT yet GALT R47 SET R56 R14 ; Initialize repeat count ; DOALTC: SET R45 R47 SET R123 11 ; STAGE = 11 BZ &CKIIFLG R56 ; All ALTs done; CLL &OBSPROC 0x0000 ; Call ALT Obs DEC R56 UBR &LISTLOOP ; All rpts are completed before exiting ; from campaign mode. CKIIFLG: BZ &CKNEWL R70 ; Check if II flag has been received SET R67 R71 ; List Address = II List Address CLR R70 ; Clear II Flag UBR &CMPGDONE ; Make a clean transition to II list ; CKNEWL: BZ &CALLOBS R68 ; Check if a new list is available SET R67 R69 ; List Address = New List Address CLR R68 ; Clear new list flag UBR &CMPGDONE ; Finish off the old list ; CALLOBS: BZ &CMPGDONE R66 ; Campaign still active? GLSQ R45 ; Get address of next list observation BEQ &CKCHAIN R45 0xFFFF ; If end of list, check for chain list SET R123 10 ; STAGE = 10 CLL &OBSPROC 0x0000 ; Do Campaign Obs UBR &LISTLOOP ; CMPGDONE: CLSL R45 ; Get address of tail obs SET R123 12 ; STAGE = 12 CLL &OBSPROC 0x0000 ; SET R10 0xFFFF ; Reset Duration in mode counter SET R55 R63 ; The interval Counter is reset if it CLR R4 ; Clear campaign flag to IP UBR &MAINLOOP ; CKCHAIN: BZ &LISTLOOP R72 ; Chain list specified? CLSL R45 ; Close current list SET R67 R73 ; List Address = Chain List address OPNL R81 R67 ; Open chain list GPRI R82 ; Get new Prime30C address CLR R72 ; Clear Chain Flag UBR &LISTLOOP ; Continue campaign loop ; ;.......................................................... ; OBSPROC: IFRM R45 R128 ; SET R0 1 ; Initialize Frame Number ; ; BEQ &SETC1 R40 4 ; DC2 R40 R41 SETC1: ; BEQ &SETC2 R36 7 ; DC2 R36 R37 SETC2: ; BEQ &NXTFRM R38 8 ; DC2 R38 R39 ; NXTFRM: DFRM R128 EXP R35 ; DFRM stores exposure value in R35 BEQ &WFTIM R43 2 ; Skip device configuration for NULL frames ; DOCON: CO1 $ $ &IPB0 BZ &WFTIM R42 ; ; Position CAL1 ; SET R91 R37 ; R91 <- New CAL1 Pos. SET R92 R88 ; R92 <- Old CAL1 Pos. CLL &SETDEVDIR 0x0000 ; Get Direction code in R90. ADD R90 7 ; Add-in device code for CAL1 DC2 R90 R37 ; Move CAL1 to new Pos. SET R88 R37 ; Save New CAL1 Pos. ; ;--- DC2 R36 R37 ; ; Position CAL2 ; SET R91 R39 ; R91 <- New CAL2 Pos. SET R92 R89 ; R92 <- Old CAL2 Pos. CLL &SETDEVDIR 0x0000 ; Get direction code in R90 ADD R90 8 ; Add-in the device code for CAL2 DC2 R90 R39 ; Move CAL1 to new Pos. SET R89 R39 ; Save New CAL2 Pos. ; ;--- DC2 R38 R39 ; WFTIM: TIM R44 ; DFRM saves time in R44 BEQ &CHKFRM R43 2 GRT R1 ; Ticks since Reference Time TAP INC R0 ; Frame_Number++; INC R11 ; Frames_in_OBS++ ; CHKFRM: BZ &DONEOBS R128 UBR &NXTFRM ; DONEOBS: RET ; ;--------------------------------------------------------------- ; ; Copy Subroutine ; CPYREG: SET R17 R57 SET R18 R58 SET R19 R59 SET R20 R62 SET R21 R63 SET R22 R67 SET R23 R69 SET R24 R71 SET R25 R73 ; SET R16 0 BZ &CHKR65 R64 ADD R16 1 CHKR65: BZ &CHKR66 R65 ADD R16 2 CHKR66: BZ &CHKR68 R66 ADD R16 4 CHKR68: BZ &CHKR70 R68 ADD R16 8 CHKR70: BZ &CHKR72 R70 ADD R16 16 CHKR72: BZ &CHKFIN R72 ADD R16 32 ; CHKFIN: RET ; ;--------------------------------------------------------------- ; ; Procedure to set device direction ; ; Register Usage: ; R90 - Direction of motion ; R91 - CAL1 Position ; R92 - CAL1 Old Position ; SETDEVDIR: SET R90 0x50 ; Clockwise Motion SUB R92 R91 BEQ &NOMOVE R92 0 BGT &POSDIF R92 0 ; POS > 0 ; ; --- -ve difference NEGDIF: BGT &ACLKW R92 0xffb8 ; -72 < POS < 0 UBR &FINSDIR ; ; --- +ve Difference POSDIF: BGT &ACLKW R92 72 ; POS > 72 UBR &FINSDIR ; ; --- 0 difference NOMOVE: SET R90 0x00 UBR &FINSDIR ; ; --- Set Direction to Anti-Clockwise ACLKW: SET R90 0x60 ; Counter Clockwise motion ; FINSDIR: RET ;-------------------------------------- ; IPB0: .IPB 0x00o 0x00o 0x01o 0x00o 0x00o 0x00o DMB0: .DMB 0x00o 0x00o 0x00o 0x00o OCB0: .OCB 0x00o 0x00o 0x00o 0x00o ; ; II LST PriT3: .IPB 0x0000 0x0000 0x0000 ; ; ALT Cad CMPG NEW C PriT2: .IPB 0x0060 0x0000 0x0000 ; ; HDR TAIL ALT RPTS PriT1: .IPB 0x0004 0x0005 0x0005 ; ; P60 P30 ALT PriT: .IPB 0x0000 0x0002 0x0003 ;===============================================================