MICA 87.lst
MICA 87.lst
MICA 87.lst
108G
2 ;
3 ; Cascades K87 Bagel Logic Prom v0.090
4 ; based on Sersio K86 TED logic prom v0.81
5 ; based on X86 logic ver 1.2 by Mark Widholm
6 ; X86 TED LOGIC PROM VER: 1.2 27-AUG-01
7 ; For K87_1 board Cascades Box 1 Tray 1
8 ;
9 ;-----------------------------------------------------------------------------
-----------
10 ;
11 ; as of September 15, 2011 it appears that M108G87.ASM
will be the MICA_87.ASM flight code
12 ;
13 ; v1.108G for MICA -- 1.108F is solid, but about 10
micrSec early (I used the 10 microSec less than nomi
nal,
so that makes sense) adjusting delay
14 ; 1.108G seems to be right, sometimes S2 does not
seem to be correct, but Sweep vs. MinF and MinF v
s.
S3 each show the correct relation,
15 ; sweep stepping happens about 17.5 microSec
BEFORE MinF pulse start, and that is between 11 and 12
5.0Hz sweeps
17 ; v1.108E for MICA -- with dropping from 70.5 to 54.0
microSec -- taking out extra JB MinF... still sc
ewy,
18 ; v1.108D for MICA -- dropping from 70.5 to 54.0
microSec (which got us solid before) is it solid again?
NO!
19 ; v1.108C for MICA -- NOW stepping about 1+ microSec
after S2 (Bagel from GSE) so lopping off another 1.
5
microSec from wait loop and checking
20 ; -- also adding MinF check right
after step and lengthening first wait loop timeout
21 ; v1.108B for MICA -- NOW stepping about 10 (+change)
microSec after S2 (Bagel from GSE) so lopping off
MajF reset
57 ; v1.104B for MICA -- changed DoubleCountGuard to have
three tests padded with NOPs, pulse should end by
then
58 ; IF (DBLCOUNTGUARD) ; 1.56
microSec / word at 6.4 M bit/sec and 10 bit words
; so
MajF or MinF pulses should last about 3-4 instru
ctions
59 ; also added CLR MINF and CLR MAJF to reset
initialization code -- force pins low if no drive
inorFrame
72 ; v1.099 for MICA - keeping old free-running as backup,
adding new code for MajorFrame syncing and synci
ng
stepping to readout using MinorFrame
73 ; start sweep when MajF, step every
OTHER MinF is basic idea; watchdog on MinF and re
vert
to free-running if three in a row not seen
74 ; v1.098 for MICA - more stuff for MajorFrame syncing
and syncing stepping to readout using MinorFrame
75 ; v1.097 for MICA - more stuff for MajorFrame syncing
and syncing stepping to readout using MinorFrame
76 ; v1.096 for MICA - start adding stuff for MajorFrame
syncing and syncing stepping to readout
77 ; v1.095 for MICA - starting version - only comment
changes from Casc2 v0.094
78 ; v1.094 for Cascades2 - added PARASYNC at end for text
id stuff
79 ; v1.093 for Cascades2 - SYNC1PPS set true (no code
reacts to this, yet)
80 ; v1.092 for Cascades2 - adds PROM labelling at end,
makes subversion numbering 3 digit
81 ; v0.091 is starting version for Cascades2 - no changes
from Casc1 v0.090
82 ; v0.090 was flight version for Cascades1
83 ;
84 ;----------------------------------------------------------------------------
------------
85 ; MICA MajF 250 MinF 8000
86 ;
87 ; MICA M1 (MajorFrameCounter1) 8, 80, 1, 1 8000SPS
88 ; MICA M2 (MajorFrameCounter2) 9, 80, 1, 1 8000SPS
89 ; MICA ID (Sub-frame ID) 3, 80, 1, 1 8000SPS
1000.0CCC.CC
90 ;
91 ; MICA Bagel K2L 68, 80, 1, 2 4000SPS K2H 69, 80,
1, 2 4000SPS
92 ;
93 ; MICA FS1 (FrameSync1) 78, 80, 1, 1 8000SPS
1111.1010.11 FAF33400
94 ; MICA FS2 (FrameSync2) 79, 80, 1, 1 8000SPS
1100.1100.11 FAF33400
95 ; MICA FS3 (FrameSync3) 80, 80, 1, 1 8000SPS
0100.0000.00 FAF33400
96 ;----------------------------------------------------------------------------
------------
97 ;
98 ;;;SERSIO comments below
99 ;;;
100 ;;;> but there is at least one timing loop in the X86
code.
101 ;;;
102 ;;;The X86 code is very processor speed dependent. It
has a tricky phase
103 ;;;lock scheme that depends on the processor clock
being a fixed
104 ;;;relationship to the TM rate. Faster would be ok but
the code would need
105 ;;;to be changed. The code might need to be changed
anyway if the TM rates
106 ;;;are different. I haven't looked at that. The
algorithm doesn't need to
107 ;;;be changed just a few timer values and wait loop
counts.
108 ;;;
109 ;;; DAC-86 to AD-7111A changes have been made. Using a
count up from zero
110 ;;; (just like DAC-86) as an index into a table for
looking up the AD-7111A
111 ;;; codes. The index into the table is the same as the
output was to the DAC-86
112 ;;; for the Sierra TED algorithm. So minimal code
changes have been necessary.
113 ;;;
114 ;;; first draft of timing changes have been made ...
and work in gross at least
115 ;;; we have approximately 1milliSec/Step now on 0.77
measured 1.000544 mS/step
116 ;;; so commented out two NOPs that had been added
(want to remove 1.5 microSec, that removes 1.0)
117 ;;;
118 ;;;SERSIO comments end
119 ;---------------------------------------------------------------------------
-------------
120 ;
121
122 ;directives added to make MetaLink ASM51.EXE happy:
123 $MOD51
124 $TITLE(K86 CPU PROM VER: MICA Bagel/K87 v1.108G)
125 $PAGEWIDTH(132)
126 $PAGEWIDTH(254)
127 $NOPAGING
128 $NODEBUG
129 $SYMBOLS
130 $OBJECT ;ASEM will object to this directive, no
problem
131
0001 132 INCLUDECAL EQU 1
133
0001 134 BagelEveryOtherStep SET 1
0000 135 BagelEveryOtherStep SET 0
136
137 ; v1.093 for Cascades2 - SYNC1PPS set true (no code
reacts to this, yet)
138 ;SYNC1PPS EQU 1 ;force energy sweep to reset at 1PPS
0000 139 SYNC1PPS EQU 0 ;don't force energy sweep to reset at
1PPS
140
0001 141 OLDSTYLE SET 1
0000 142 NEWSTYLE SET 0
143 ;OLDSTYLE SET 0
144 ;NEWSTYLE SET 1
145 IF (OLDSTYLE)
0000 146 NEWSTYLE SET 0
147 ELSE
148 IF (NEWSTYLE)
149 ELSE
150 OLDSTYLE SET 1 ;IF NEITHER IS SET, SET OLDSTYLE ON
151 ENDIF ;IF (NEWSTYLE)
152 ENDIF ;IF (OLDSTYLE)
153
0000 154 SyncCount SET 0 ; do not do this; SETTING value
to zero disables the tests and avoids generating t
he
code
155
0001 156 FALLBACK SET 1 ;enable FallBack to Free-
running ;added V1.107K -> 1.107M
0000 157 FALLBACK SET 0 ;disable FallBack to Free-
running ;added V1.107K -> 1.107M
158
0001 159 WORKAROUND SET 1 ; two RRCs
0000 160 WORKAROUND SET 0 ; one RRC
161
0001 162 NOFRAMES SET 1
0000 163 NOFRAMES SET 0
164
165 IF (NOFRAMES)
166 DO_MAJF SET 0 ;added V1.107K -> 1.107M
167 CountMinF SET 0 ;not counting MinFs, just
using every one
168 DBLCOUNTGUARDJ SET 0
169 DBLCOUNTGUARDN SET 0
170 WORKAROUND SET 0 ; one RRC
171 ELSE ;IF (NOFRAMES)
0001 172 DO_MAJF SET 1 ;added V1.107K -> 1.107M
0000 173 DO_MAJF SET 0 ;added V1.107K -> 1.107M
0001 174 CountMinF SET 1 ;counting MinFs
0000 175 CountMinF SET 0 ;not counting MinFs, just
using every one
176 ENDIF ; IF (NOFRAMES)
177
178 IF (DO_MAJF)
179 ; MajF double count guard code enable flag -- not using
if not counting pulses
180 DBLCOUNTGUARDJ SET 1
181 DBLCOUNTGUARDJ SET 0
182 ;SyncCount SET 128 ;80H -- every 128 MajFs,
restart the sweep (a little less than twice a second
as
MajF is 250/second)
183 SyncCount SET 0 ; do not do this; SETTING value
to zero disables the tests and avoids generating t
he
code
184 ELSE ;IF (DO_MAJF)
0000 185 DBLCOUNTGUARDJ SET 0
186 ;SyncCount SET 128 ;80H -- every 128 MajFs,
restart the sweep (a little less than twice a second
as
MajF is 250/second)
0000 187 SyncCount SET 0 ; do not do this; SETTING value
to zero disables the tests and avoids generating t
he
code
188 ENDIF ;IF (DO_MAJF)
189
190 IF (CountMinF)
191 ; MinF double count guard code enable flag -- not using
if not counting pulses
192 DBLCOUNTGUARDN SET 1
193 DBLCOUNTGUARDN SET 0
194 ELSE ;IF (CountMinF)
0000 195 DBLCOUNTGUARDN SET 0
0000 196 WORKAROUND SET 0
0000 197 BagelEveryOtherStep SET 0
198 ENDIF ;IF (CountMinF)
199
0000 200 UseInterrupt SET 0
0001 201 UseInterrupt SET 1
202
203 ;___________________________________________________________________________
____________________________
____
204 ; MACROS MACROS MACROS
205 ;___________________________________________________________________________
____________________________
____
206
207 PARASYNC MACRO
208 EOC SET ($/16)
209 EOC SET (EOC+1)*16
210 ORG EOC
211 ENDM
212
213 WATCHDOG MACRO
214 MOV IE,#00H ;DISable all interrupts
215 CLR PCLR ;TOGGLE PCLR FOR WATCHDOG
216 NOP
217 NOP
218 SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
219 IF (UseInterrupt)
220 MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.1
08F
221 ELSE ;IF (UseInterrupt)
222 MOV IE,#80H ;enable interrupts, but not Ext Int 1
or any other specific interrupt ;M107J87 - >
M107K87
223 ENDIF ;IF (UseInterrupt)
224 ENDM
225
226 ;___________________________________________________________________________
____________________________
____
227
228 ;---------------------------------------------------------------------------
-------------
229
230 USING 0 ;Select addresses for Bank 0
231
232 ; PORT USAGE
233 ; P0 UNUSED
234 ; P1 TEST bits
235 ; P2 SWEEP DAC parallel bits ;DAC-86 counts up, AD-
7111A counts down need to adjust
236 ; P3 ctr and majf
237
238 ; SFR DEFS
239 ;TL1 EQU 08BH ;TIMER1 LO BYTE
240 ;TH1 EQU 08DH ;TIMER1 HI BYTE
241
242 ; IO BITS
243 ; TGATE, DACK and UPDN used in TED but not in Bagel
244 ; P0 not used in Bagel
245 ;TGATE BIT P0.0 ;TEST OSC GATE
246 ;DACK BIT P0.6 ;SKIN DAC CLOCK
247 ;UPDN BIT P0.7 ;SKIN DAC UP/DOWN SEL
248
249 ; P1 not used in Bagel
0090 250 CAL BIT P1.0 ;CAL MODE. JUMPER TO GND TO ACTIVATE
0091 251 SYN BIT P1.1 ;SYNC DEBUG BIT
0092 252 SNRG BIT P1.2 ;CAL JPR. STEP ENERGY
0093 253 EDGE BIT P1.3 ;PEAK HI-COUNT EDGE (SOFTWARE FLAG)
0094 254 SSKN BIT P1.4 ;CAL JPR. STEP SKIN V
255 ;PK BIT P1.5 ;PEAK DETECT DEBUG BIT
256
257 ;P2 0..7 SWEEP STEP
258
259 ; P3.2 ;(INT0) PCLR
00B2 260 PCLR BIT P3.2 ;now used for KeepAlive signal to
watch dog ;PRESCALER CLEAR
261 ; P3.3 ;(INT1) MAJF
00B3 262 MAJF BIT P3.3 ;MinF rerouted here for
interrupt use ;v1.108E -> v1.108F
263 ; P3.4 ;(T0) COUNTER INPUT
264 ; P3.5 ;(MinF) Minor Frame (T1)
00B5 265 MINF BIT P3.5
266
267
268 ; on Sierra, TED1 in word 55. On Sersio, TED1 in word
13
269 ;DLY EQU 42 ;TED1 SAMPLE (WD 55) DELAY FROM MAJF
(98USEC-14)/2 ;timing dependency
0009 270 DLY EQU 9 ;TED1 SAMPLE (WD 13) DELAY FROM MAJF
[(16.25USEC-7)/2]*2 ;timing dependency -- needs c
272 ;---------------------------------------------------------------------------
-------------
273
274 ;REG USAGE
275 ;R0 scratch
276 ;R1 scratch in Calibrate, unused in main loop
277 ;R2 <unused>
278 ;R3 scratch ?? not needed, now unused
279 ;R4 <unused>
280 ;R5 <unused>
281 ;R6 <unused>
282 ;R7 <unused>
283
284 ;---------------------------------------------------------------------------
-------------
---- 285 DSEG
286 ;INTERNAL RAM
0020 287 ORG 20H ;get past all four register banks
288 ; MAX and PEAK used in TED not in Bagel
0020 289 STEP: DS 1 ;sweep step number
0021 290 RST: DS 1
0022 291 MajFCnt: DS 1
0023 292 MinFCnt: DS 1
0024 293 DoRestart: DS 1
294
0025 295 VECL: DS 1
0026 296 VECH: DS 1
0027 297 DS 8
002F 298 IGNORE: DS 3
299
300
301 ;---------------------------------------------------------------------------
-------------
302 ;----------------------------------------------
303
---- 304 CSEG
0000 305 ORG 0
0000 020064 306 JMP RESET
307
308 ; should not execute the following
0003 309 ORG 3 ;IE0
310 ; MOV SP,#3FH
0003 C2B0 311 CLR P3.0
0005 02002D 312 JMP TOIDLE
313
314 ; should not execute the following
000B 315 ORG 0BH ;TF0
316 ; MOV SP,#3FH
000B C2B1 317 CLR P3.1
000D 02002D 318 JMP TOIDLE
319
320 ;; should execute the following on MajF pulse or on
MinF pulse with rerouting ;v1.108E -> v1.108F
M107K87
391 +1 ENDIF ;IF (UseInterrupt)
393 ; MOV IE,#00H ;DISable all interrupts
394 ; CLR PCLR
395 ; NOP
396 ; NOP
397 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
398 ; CLR EDGE
399 ;
400 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
401 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
402
0061 0200A6 403 JMP IDLEPLUS
404
405
406 ;----------------------------------------------
0064 407 RESET:
0064 75B0FF 408 MOV P3,#0FFH
0067 409 RESET2:
0067 74FF 410 MOV A,#0FFH
0069 F521 411 MOV RST,A
006B F524 412 MOV DoRestart,A ; added 1.099 for New style
sweep sync support
006D 413 RESET4:
006D 7590FF 414 MOV P1,#0FFH
0070 7580FF 415 MOV P0,#0FFH
0073 75813F 416 MOV SP,#3FH
0076 758915 417 MOV TMOD,#15H ;TIMER0 16-BIT COUNTER, TIMER1 16
BIT TIMER
418 ; both under software control
419 ; MOV TCON,#54H ;EDGE TRIG INT1, ENABLE TIMER AND
COUNTER
420 ;; turn on both TIMERs, set INT0 as edge triggered
(but we won't use it as an interrupt)
0079 758850 421 MOV TCON,#50H ;EDGE TRIG INT1, ENABLE TIMER AND
COUNTER ;107J -> 107K
422 ; turn on both TIMERs, set INT0 as level triggered
(but we won't use it as an interrupt)
423 ; MOV A,#0 ;SWEEP STEP = 0 -- move initial value
to A then to STEP as we will use it again in two
instructions
007C E4 424 CLR A ;intent is MOV A,#0
007D F520 425 MOV STEP,A ;SWEEP STEP = 0
007F F522 426 MOV MajFCnt,A ; added 1.099 for New style sweep
sync support
0081 F523 427 MOV MinFCnt,A ; added 1.099 for New style sweep
sync support
0083 900400 428 MOV DPTR,#TABLE ;PREPARE FOR AD SWEEP LOOK-UP --
DPTR should keep value throughout rest of program
M107K87
447 +1 ENDIF ;IF (UseInterrupt)
449 ; MOV IE,#00H ;DISable all interrupts
450 ; CLR PCLR
451 ; NOP
452 ; NOP
453 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
454 ; CLR EDGE
455 ;
456 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
457 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
458
00A1 209005 459 JB CAL,IDLE ;CHECK FOR CAL MODE
460 IF (INCLUDECAL > 0)
00A4 2146 461 AJMP DOCAL
462 ENDIF
463
464 ;----------------------------------------------
; old style fr
ee-
running
465 ;LOOP FOR EACH 1MS ENERGY STEP.
466 ; CODE FROM IDLE TO WT ISN'T TIME CRITCAL AS LONG AS IT
IS << 1/2MS
467 ;
; old style fr
ee-
running
00A6 468 IDLEPLUS:
00A6 75813F 469 MOV SP,#3FH
00A9 470 IDLE:
471 +1 WATCHDOG
00A9 75A800 472 +1 MOV IE,#00H ;DISable all interrupts
00AC C2B2 473 +1 CLR PCLR ;TOGGLE PCLR FOR WATCHDOG
00AE 00 474 +1 NOP
00AF 00 475 +1 NOP
00B0 D2B2 476 +1 SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
477 +1 IF (UseInterrupt)
00B2 75A884 478 +1 MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.1
08F
479 +1 ELSE ;IF (UseInterrupt)
480 +1 MOV IE,#80H ;enable interrupts, but not Ext Int 1
or any other specific interrupt ;M107J87 - >
M107K87
481 +1 ENDIF ;IF (UseInterrupt)
483 ; MOV IE,#00H ;DISable all interrupts
484 ; CLR PCLR
485 ; NOP
486 ; NOP
487 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
488 ; CLR EDGE
489 ;
490 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
491 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
492
00B5 E520 493 MOV A,STEP ;GENERATE TEST GATE BASED ON SWEEP STEP
;AD-7111 change made ;using index & table lo
okup
494
495 ;---1-------------------------------------------
; old style f
ree-
running
00B7 758DFC 496 MOV TH1,#0FCH ;64648d ;timing dependency - ?
fixed
00BA 758B88 497 MOV TL1,#088H ;RELOAD -986USEC/2. -(999-13USEC)
498 ; For 444.000000 microSec, @ 24.0000MHz, count =
64648, FC88
499 ; MOV TH1,#0FCH ;64550d ;timing dependency - ?
fixed
500 ; MOV TL1,#026H ;RELOAD -986USEC/2. -(999-13USEC)
501 ;; For 493.000000 microSec, @ 24.0000MHz,
count = 64550, FC26
502 ;; MOV TH1,#0FFH ;65301d ;timing dependency
- ?fixed
503 ;; MOV TL1,#015H ;RELOAD -986USEC/2. -(999-13USEC)
504 ;;; 117.50, 65301,'FF15'
00BD 505 WT:
; old style fr
ee-
running
506 ; CHECK FOR MINOR FRAME IN LOOP, GOTO STEPPING IF FOUND
507 ;
508 IF (NOFRAMES)
509 ELSE ;IF (NOFRAMES)
00BD 20B55B 510 JB MINF,D0NEW
511 IF (DO_MAJF) ; V1.107K -
> 1.107M
512 JB MAJF,DONEW ; v1.104 -
> 1.105
513 ENDIF ;IF (DO_MAJF) ; V1.107K -
> 1.107M
514 ENDIF ;IF (NOFRAMES)
00C0 308FFA 515 JNB TF1,WT ;WAIT FOR first 1/2 mSec timer (1.0+
MSEC TIMER total)
516
517 ;----------------------------------------------
; old style fr
ee-
running
00C3 C28E 518 CLR TR1 ;STOP TIMER
519 +1 WATCHDOG
00C5 75A800 520 +1 MOV IE,#00H ;DISable all interrupts
00C8 C2B2 521 +1 CLR PCLR ;TOGGLE PCLR FOR WATCHDOG
00CA 00 522 +1 NOP
00CB 00 523 +1 NOP
00CC D2B2 524 +1 SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
525 +1 IF (UseInterrupt)
00CE 75A884 526 +1 MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.1
08F
527 +1 ELSE ;IF (UseInterrupt)
528 +1 MOV IE,#80H ;enable interrupts, but not Ext Int 1
or any other specific interrupt ;M107J87 - >
M107K87
529 +1 ENDIF ;IF (UseInterrupt)
531 ; MOV IE,#00H ;DISable all interrupts
532 ; CLR PCLR
533 ; NOP
534 ; NOP
535 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
536 ; CLR EDGE
537 ;
538 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
539 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
540
541 ;---2-------------------------------------------
; old style
free-running
00D1 758DFC 542 MOV TH1,#0FCH ;64648d ;timing dependency - ?
fixed
00D4 758B88 543 MOV TL1,#088H ;RELOAD -986USEC/2. -(999-13USEC)
544 ; For 444.000000 microSec, @ 24.0000MHz, count =
64648, FC88
545 ; MOV TH1,#0FCH ;64550d ;timing dependency - ?
fixed
546 ; MOV TL1,#026H ;RELOAD -986USEC/2. -(999-13USEC)
547 ;; For 493.000000 microSec, @ 24.0000MHz,
count = 64550, FC26
548 ;; MOV TH1,#0FFH ;65301d ;timing dependency
- ?fixed
549 ;; MOV TL1,#015H ;RELOAD -986USEC/2. -(999-13USEC)
550 ;;; 117.50, 65301,'FF15'
00D7 C28F 551 CLR TF1 ;CLEAR TIMER INTR ;added 0.75 ->0.76
(Duh!)
00D9 D28E 552 SETB TR1 ;restart timer
553
00DB 554 WT2:
; old style fr
ee-
running
555 ; CHECK FOR MINOR FRAME IN LOOP, GOTO STEPPING IF FOUND
556 ;
557 IF (NOFRAMES)
558 ELSE ;IF (NOFRAMES)
00DB 20B53D 559 JB MINF,D0NEW
560 IF (DO_MAJF) ; V1.107K -
> 1.107M
561 JB MAJF,DONEW ; v1.104 -
> 1.105
562 ENDIF ;IF (DO_MAJF) ; V1.107K -
> 1.107M
563 ENDIF ;IF (NOFRAMES)
00DE 308FFA 564 JNB TF1,WT2 ;WAIT FOR second 1/2 mSec timer (1.0+
MSEC TIMER total)
565
566 ;----------------------------------------------
; old style fr
ee-
running
567 +1 WATCHDOG
00E1 75A800 568 +1 MOV IE,#00H ;DISable all interrupts
00E4 C2B2 569 +1 CLR PCLR ;TOGGLE PCLR FOR WATCHDOG
00E6 00 570 +1 NOP
00E7 00 571 +1 NOP
00E8 D2B2 572 +1 SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
573 +1 IF (UseInterrupt)
00EA 75A884 574 +1 MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.1
08F
575 +1 ELSE ;IF (UseInterrupt)
576 +1 MOV IE,#80H ;enable interrupts, but not Ext Int 1
or any other specific interrupt ;M107J87 - >
M107K87
577 +1 ENDIF ;IF (UseInterrupt)
579 ; MOV IE,#00H ;DISable all interrupts
580 ; CLR PCLR
581 ; NOP
582 ; NOP
583 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
584 ; CLR EDGE
585 ;
586 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
587 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
588
00ED C28E 589 CLR TR1 ;STOP TIMER
590 ;---3-------------------------------------------
; old style f
ree-
running
style free-running
M107K87
624 +1 ENDIF ;IF (UseInterrupt)
626 ; MOV IE,#00H ;DISable all interrupts
627 ; CLR PCLR
628 ; NOP
629 ; NOP
630 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
631 ; CLR EDGE
632 ;
633 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
634 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
635
010B C28E 636 CLR TR1 ;STOP TIMER
010D 758DFF 637 MOV TH1,#0FFH ;65301d ;timing dependency - ?
fixed
0110 758B15 638 MOV TL1,#015H ;RELOAD -986USEC/2. -(999-13USEC)
639 ; 117.50, 65301,'FF15'
640
; old style fr
ee-
running
0113 641 DOSTEP:
0113 E520 642 MOV A,STEP ;using index & table lookup no further
change needed
0115 02011E 643 JMP STRT1
; old style fr
ee-
running
644
0118 645 DONEW:
646 ; step every other MinF, when MajF comes, if DoRestart
is set, restart sweep; restart sweep even *N* Maj
F
anyway
0118 020200 647 JMP StartNewStyleSweep
648
011B 649 D0NEW:
650 ; step every other MinF, when MajF comes, if DoRestart
is set, restart sweep; restart sweep even *N* Maj
F
anyway
011B 020208 651 JMP ContinueNewStyleSweep
652
653 ;
654 ;; code below not used
655 ; ANL A,#07H ;CHECK MajF every 4th, but Bagel uses
every other step ;BAGEL uses 32 steps not 64 s
teps
656 ; JNZ STRT1
657 ; ;TIMER IS NOMINAL (Sierra) 4USEC SHORT (?? should
be same for Sersio but processor speed twice as
fast)
658 ; JB IE1,STRT ;HOLD TIMER UNTIL MAJF EDGE IS
DETECTED ;number of JB instructions doubled as CPU c
M107K87
691 +1 ENDIF ;IF (UseInterrupt)
693 ; MOV IE,#00H ;DISable all interrupts
694 ; CLR PCLR
695 ; NOP
696 ; NOP
697 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
698 ; CLR EDGE
699 ;
700 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
701 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
702
703
704 ;----------------------------------------------
; old style fr
ee-
running
0136 7809 705 MOV R0,#DLY
0138 706 WT1:
0138 D8FE 707 DJNZ R0,WT1 ;WAIT TED1 SAMPLE DELAY FROM MAJF
708 ;----------------------------------------------
013A E520 709 MOV A,STEP ;using index & table lookup no
further change needed
710 ; MOV R3,A ;SAVE STEP NUMBER OF THIS ACCUM
013C 04 711 INC A ;using index & table lookup no
further change needed
712 IF (BagelEveryOtherStep)
713 INC A ;BAGEL uses 32 steps not 64 steps,
so Bagel uses every OTHER step in table
714 ENDIF ;IF (BagelEveryOtherStep)
013D 543F 715 ANL A,#3FH ;MOD 64 ;using index & table
lookup no further change needed
013F F520 716 MOV STEP,A ;Duh! leave this out and of course the
sweep doesn't update
717 ; MOV DPTR,#TABLE ;DONE DURING INITIALIZATION
0141 93 718 MOVC A,@A+DPTR ;AD-7111 change done
0142 F5A0 719 MOV P2,A ;BUMP TO NEXT ENERGY STEP ;AD-7111
change done
720
0144 01A9 721 JMP IDLE ;NO - LOOP FOR NEXT STEP
722
723
724 IF (INCLUDECAL > 0)
725 ;-------------------------------------------------
726 ;CAL MODE IS ENTERED BY JUMPERING CAL BIT TO GND AND
RESETTING CPU
727 ;IT ALLOWS SINGLE STEPPING THE SKIN OR ENERGY DACS
728 ; BOTH DACS ARE SET TO 0 AFTER RESET
729 ; A LOW PULSE >1US AND <512US WILL SINGLE STEP
730 ; IF THE BIT IS HELD LOW THE DAC WILL STEP CONTINUOUSLY
EVERY 512US
731
0146 732 DOCAL:
0146 7840 733 MOV R0,#64
734
0148 735 LPZ:
0148 D8FE 736 DJNZ R0,LPZ
014A 7940 737 MOV R1,#64
738
014C D8FE 739 STALL: DJNZ R0,STALL ;WAIT 512USEC (R0 IS
0) ;timing dependency - ? DONE
740
741 +1 WATCHDOG
014E 75A800 742 +1 MOV IE,#00H ;DISable all interrupts
0151 C2B2 743 +1 CLR PCLR ;TOGGLE PCLR FOR WATCHDOG
0153 00 744 +1 NOP
0154 00 745 +1 NOP
0155 D2B2 746 +1 SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
747 +1 IF (UseInterrupt)
0157 75A884 748 +1 MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.1
08F
749 +1 ELSE ;IF (UseInterrupt)
750 +1 MOV IE,#80H ;enable interrupts, but not Ext Int 1
or any other specific interrupt ;M107J87 - >
M107K87
751 +1 ENDIF ;IF (UseInterrupt)
753 ; MOV IE,#00H ;DISable all interrupts
754 ; CLR PCLR
755 ; NOP
756 ; NOP
757 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
758 ; CLR EDGE
759 ;
760 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
761 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
762
015A 7840 763 MOV R0,#64
015C D8FE 764 STALL2: DJNZ R0,STALL2 ;DOUBLED TO ACCOUNT FOR 2x CPU
CLOCK
765
015E 766 CALP:
767 +1 WATCHDOG
015E 75A800 768 +1 MOV IE,#00H ;DISable all interrupts
0161 C2B2 769 +1 CLR PCLR ;TOGGLE PCLR FOR WATCHDOG
0163 00 770 +1 NOP
0164 00 771 +1 NOP
0165 D2B2 772 +1 SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
773 +1 IF (UseInterrupt)
0167 75A884 774 +1 MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.1
08F
775 +1 ELSE ;IF (UseInterrupt)
776 +1 MOV IE,#80H ;enable interrupts, but not Ext Int 1
or any other specific interrupt ;M107J87 - >
M107K87
777 +1 ENDIF ;IF (UseInterrupt)
779 ; MOV IE,#00H ;DISable all interrupts
780 ; CLR PCLR
781 ; NOP
782 ; NOP
783 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
784 ; CLR EDGE
785 ;
786 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
787 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
788
789
016A 309208 790 JNB SNRG,STEPN ;WAIT FOR EITHER STEP BIT TO GO LOW
016D 30940D 791 JNB SSKN,STEPS
0170 3090EB 792 JNB CAL,CALP
0173 0164 793 JMP RESET ;EXIT IF CAL BIT GOES HI
794
795 ;AD-7111 change - using index & table
lookup no further change needed
0175 796 STEPN:
0175 E520 797 MOV A,STEP ;STEP ENERGY ;AD-7111 change
- using index & table lookup no further change
needed
0177 04 798 INC A ;STEP ENERGY
0178 93 799 MOVC A,@A+DPTR
0179 F5A0 800 MOV P2,A
017B 80CF 801 JMP STALL
802
017D 803 STEPS:
017D D9CD 804 DJNZ R1,STALL ;COUNT STEPS
017F 80C5 805 JMP DOCAL ;RESET AFTER 63
806
807 ENDIF ; IF (INCLUDECAL > 0) THEN
808
809 ;===========================================================================
============================
=================================
810
0200 811 ORG 0200H
0200 812 StartNewStyleSweep:
813 ; step every other MinF, when MajF comes, if DoRestart
is set, restart sweep; restart sweep even *N* Maj
F
anyway
814 ; N should be a multiple of 4, sweep will take either 2
or 4 MajorFrames (depending whether 32 or 64 st
eps
in sweep)
815 ;
0200 E4 816 CLR A
0201 F523 817 MOV MinFCnt,A
818 ; INC A ;v1.107S
-> 1.107U
0203 F522 819 MOV MajFCnt,A
0205 02020D 820 JMP NewStyleSweep
821 ;----------------------------------------------
0208 822 ContinueNewStyleSweep: ; v1.104
-> 1.105
0208 E4 823 CLR A ; v1.104
-> 1.105
0209 F522 824 MOV MajFCnt,A ; v1.104
-> 1.105
825 ; INC A ;v1.107S
-> 1.107U ; v1.104 -> 1.105
020B F523 826 MOV MinFCnt,A ; v1.104
-> 1.105
827 ; JMP NewStyleSweep
828 ;----------------------------------------------
; new style
829
020D 830 NewStyleSweep:
831
832 ; V1.108F -- after much testing trying to sync Bagel
sweep stepping to TM framing, we note:
833 ; for MICA we should have MinF ticks every 125
milliSec and with the later TM layout, we get the Bag
el
read every MinF
834 ; MinF should happen in the last word of the minor
frame
835 ; For MICA, Bagel is readout in words 68,69 of an
eighty word frame
836 ; The length of the MinF pulse is one word, which
for MICA is 1.56 microSec.
837 ; Running at 24MHz, the AT89S52 executes
instructions in either 1/2 or 1 microSec, depending upon the
instruction
838 ; BUT it appears to have problems reliably "seeing"
the MinF pulse every time one comes along.
839 ; Putting a pulse stretcher circuit on the MinF line
seems majorly hokey, but 8051-style external int
pendency - ?fixed
847 ; JB MINF,MINF1 ;v1.107U -> v1.108
0210 758B18 848 MOV TL1,#018H ;RELOAD 500 microSec
849 ; JB MINF,MINF1 ;v1.107U -> v1.108
850 ; 500.00, 64536, FC18
851 ;For 250.000000 microSec, @ 24.0000MHz, count =
65036, FE0C
852 ;For 500.000000 microSec, @ 24.0000MHz, count =
64536, FC18
853 ;
854 ;; MOV TH1,#0FCH ;64536d
;timing dependency - ?fixed
M107K87
880 +1 ENDIF ;IF (UseInterrupt)
882 ; MOV IE,#00H ;DISable all interrupts
883 ; CLR PCLR
884 ; NOP
885 ; NOP
886 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
887 ; CLR EDGE
888 ;
889 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
890 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
891
0229 C28E 892 CLR TR1 ;STOP TIMER
893
022B 894 Wait2:
895 ;wait for MinF/MajF -- wait #1
022B 758DFE 896 MOV TH1,#0FEH ;65036d ;v1.107K -
> 1.107M ;timing dependency - ?fixed
022E 758B0C 897 MOV TL1,#00CH ;RELOAD 250 microSec
898 ; 250.00, 65036, FE0C
899 ;For 250.000000 microSec, @ 24.0000MHz, count =
65036, FE0C
900 ;
901 ;; MOV TH1,#0FCH ;64536d
;timing dependency - ?fixed
M107K87
927 +1 ENDIF ;IF (UseInterrupt)
929 ; MOV IE,#00H ;DISable all interrupts
930 ; CLR PCLR
931 ; NOP
932 ; NOP
933 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
934 ; CLR EDGE
935 ;
936 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
937 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
938
0247 C28E 939 CLR TR1 ;STOP TIMER
940
941 IF (FALLBACK) ;V1.107K -> 1.107M
942 ;; no MinF for 1 milliSec (8 MinF periods) we Do A Step
and go into free running loop
943 JMP DOSTEP ;v1.107C -> 1.107D ;v1.107B ->
1.107C
944 ENDIF ;IF (FALLBACK) ;V1.107K -> 1.107M
945
946 ;; no MinF for 1 milliSec (8 MinF periods) we RESET and
go into free running loop
947 ; JMP RESET
948
949 ;----------------------------------------------
0249 950 MINF1:
951 +1 WATCHDOG
0249 75A800 952 +1 MOV IE,#00H ;DISable all interrupts
024C C2B2 953 +1 CLR PCLR ;TOGGLE PCLR FOR WATCHDOG
024E 00 954 +1 NOP
024F 00 955 +1 NOP
0250 D2B2 956 +1 SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
957 +1 IF (UseInterrupt)
0252 75A884 958 +1 MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.1
08F
959 +1 ELSE ;IF (UseInterrupt)
960 +1 MOV IE,#80H ;enable interrupts, but not Ext Int 1
or any other specific interrupt ;M107J87 - >
M107K87
961 +1 ENDIF ;IF (UseInterrupt)
963 ; MOV IE,#00H ;DISable all interrupts
964 ; CLR PCLR
965 ; NOP
966 ; NOP
967 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
968 ; CLR EDGE
969 ;
970 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
971 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
972
973 ;;;----------------------------------------------
; new styl
e
974 ;;IF (DBLCOUNTGUARD)
975 ;;MINF2:
; added 1.103 -> 1.104
976 ;; JB MINF,MINF2
; added 1.103 -> 1.104
977 ;;ENDIF ;IF (DBLCOUNTGUARD)
978 ;;;----------------------------------------------
979 ;----------------------------------------------
980 ;v1.107F -> 1.107G
981 IF (DBLCOUNTGUARDN) ; 1.56 microSec /
word at 6.4 M bit/sec and 10 bit words; so MajF o
r
MinF pulses should last about 3-4 instructions
982 NOP
983 NOP ;v1.107G -> 1.107H
984 NOP ;v1.107G -> 1.107H
985 NOP ;v1.107G -> 1.107H
986 NOP ;v1.107E -> 1.107F
987 CLR MINF ;v1.107H -> 1.107J
988 JB MINF,MINF2
989 JMP OUT_MINF
990 MINF2: ;
added 1.103 -> 1.104
991 NOP
992 NOP ;v1.107G -> 1.107H
993 NOP ;v1.107G -> 1.107H
994 NOP ;v1.107G -> 1.107H
995 NOP ;v1.107E -> 1.107F
996 CLR MINF ;v1.107H -> 1.107J
997 JB MINF,MINF3
998 JMP OUT_MINF
999 MINF3: ;
added 1.104A -> 1.104B
1000 NOP
1001 NOP ;v1.107G -> 1.107H
1002 NOP ;v1.107G -> 1.107H
1003 NOP ;v1.107G -> 1.107H
1004 NOP ;v1.107E -> 1.107F
1005 CLR MINF ;v1.107H -> 1.107J
1006 JB MINF,MINF4
1007 JMP OUT_MINF
1008 ;
1009 ; get here and apparently MinF is stuck on, so go into
free-running at SWT2 ;v1.107C -> 1.107D
1010 MINF4: ;
added 1.104A -> 1.104B
1011 CLR MINF
1012 ; JMP NWT2 ;v1.107B -> 1.107C
1013 IF (FALLBACK) ;V1.107K - 1.107M
1014 JMP SWT2 ;v1.107C -> 1.107D ;v1.107B ->
1.107C ;out to free-running, 'cause MinF appears
stuck on
1015 ELSE ;IF (FALLBACK) ;V1.107K - 1.107M
1016 JMP OUT_MINF ;V1.107K - 1.107M
1017 ENDIF ;IF (FALLBACK) ;V1.107K - 1.107M
1018 JMP OUT_MINF ;V1.107U - 1.108
1019 ENDIF ;IF (DBLCOUNTGUARDN) ;v1.107F -> 1.107G
1020 ;----------------------------------------------
; new style
; new style
1090 MOV A,MajFCnt
1091 INC A
1092 MOV MajFCnt,A
1093
1094 IF (SyncCount<>0) ;
added v1.107K -> v1.107M
1095 ; test for sweep reset
1096 CLR C
1097 SUBB A,#SyncCount
1098 JZ ResetTheSweep
1099 JC ResetTheSweep ;
added 1.104 -> 1.105
1100 ENDIF ;IF (SyncCount<>0) ;
added v1.107K -> v1.107M
1101 JMP Wait1
1102 ENDIF ;IF (DO_MAJF) ; V1.107P -
> 1.107S
1103
1104 ;----------------------------------------------
; new style
1105
0258 1106 ResetTheSweep:
1107
1108 IF (SyncCount<>0) ;
added v1.107K -> v1.107M
1109 CLR A ;intent is MOV A,#0
1110 MOV MajFCnt,A
1111 MOV STEP,A ;SWEEP STEP = 0
1112 ; MOV DPTR,#TABLE ;PREPARE FOR AD SWEEP LOOK-UP --
DPTR should keep value throughout rest of program
; new style
1136 ELSE ;IF (CountMinF)
1137 ENDIF ;IF (CountMinF)
1138
1139
1140 ;==========================================================================
=============================
=================================
1141
0300 1142 org 0300H
0300 1143 DO_IT:
1144
0300 75812F 1145 MOV SP,#IGNORE ;PLACE TO PUT PC IF INTERUPTED
1146
1147 ; now Do Stepping
PREP ;V1.107S -> 1.107U
1148 ;----------------------------------------------
; new style
0303 E520 1149 MOV A,STEP ;using index & table lookup no
further change needed ;V1.107S -> 1.107U
1150 ; MOV R3,A ;SAVE STEP NUMBER OF THIS ACCUM
0305 04 1151 INC A ;using index & table lookup no
further change needed ;V1.107S -> 1.107U
1152 IF (BagelEveryOtherStep)
1153 INC A ;BAGEL uses 32 steps not 64 steps,
so Bagel uses every OTHER step in table
1154 ENDIF ;IF (BagelEveryOtherStep)
0306 543F 1155 ANL A,#3FH ;MOD 64 ;using index & table
lookup no further change needed
0308 F520 1156 MOV STEP,A ;Duh! leave this out and of course the
sweep doesn't update ;V1.107S -> 1.107U
1157 ; MOV DPTR,#TABLE ;DONE DURING INITIALIZATION
030A 93 1158 MOVC A,@A+DPTR ;AD-7111 change done
;V1.107S -> 1.107U
1159 ; MOV P2,A ;BUMP TO NEXT ENERGY
STEP ;AD-7111 change done
1160
1161 ;----------------------------------------------
STEPPING STEPPING STEPPING STEPPING STEPPING STEPPING
1162 ; do sweep step after waiting 094 word times == 106 -
12 = 94 ;V1.107U -> 1.108
1163 ; do sweep step after waiting 084 word times == 106 -
12 - 10 = 84 ;V1.108 -> 1.108A
1164 ; do sweep step after waiting 072 word times == 106 -
12 - 10 -12more = 72 ;V1.108A -> 1.108B
1165 ; do sweep step after waiting ??? word times == 106 -
12 - 10 -12more -1.5 = 70.5 ;V1.108B -> 1.108C
1166 ; do sweep step after waiting ??? word times == 106 -
12 - 10 = 84 ;V1.108E -> 1.108F
1167 ; do sweep step after waiting 094 word times == 106 -
12 = 94 ;V1.108F -> 1.108G
030B 758DFF 1168 MOV TH1,#0FFH ;0FF44H== 65348d for 94.0
microSec
030E 758B44 1169 MOV TL1,#044H ;RELOAD 94.0 microSec
1170 ; For 94.000000 microSec, @ 24.0000MHz, count =
65348, FF44 ;V1.108F -> 1.108G
; new style
1183 ;
0315 308FFD 1184 JNB TF1,SWT ;WAIT for 84.0 microSec
1185 ;----------------------------------------------
; new style
1186
1187
1188 ; now Do Stepping -- PREP already done
;V1.107S -> 1.107U
1189 ;----------------------------------------------
; new style
M107K87
1208 ENDIF ;IF (UseInterrupt)
1209
031D 410D 1210 JMP NewStyleSweep
1211
1212 ;----------------------------------------------
; new style
1213
031F 0164 1214 JMP RESET
1215 ;__________________________________________________________________________
_____________________________
_
1216
0321 1217 SWT2:
; old style fr
ee-
running. framing checks removed
1218 ; CHECK FOR MINOR FRAME IN LOOP, GOTO STEPPING IF FOUND
1219 ;
0321 308FFD 1220 JNB TF1,SWT2 ;WAIT FOR second 1/2 mSec timer (1.0+
MSEC TIMER total)
1221
1222 ;----------------------------------------------
0324 75A800 1223 MOV IE,#00H ;DISable all interrupts
; old style free-run
M107K87
1234 +1 ENDIF ;IF (UseInterrupt)
1236 ; MOV IE,#00H ;DISable all interrupts
1237 ; CLR PCLR
1238 ; NOP
1239 ; NOP
1240 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
1241 ; CLR EDGE
1242 ;
1243 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
1244 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
1245
0333 C28E 1246 CLR TR1 ;STOP TIMER
1247 ;---3S-------------------------------------------
; old styl
e
free-running
0335 758DFC 1248 MOV TH1,#0FCH ;64648d ;timing dependency - ?
fixed
0338 758B88 1249 MOV TL1,#088H ;RELOAD
1250 ; For 444.000000 microSec, @ 24.0000MHz, count =
64648, FC88
033B C28F 1251 CLR TF1 ;CLEAR TIMER INTR ;added 0.75 ->0.76
(Duh!)
033D D28E 1252 SETB TR1 ;restart timer
1253
033F 1254 SWT3:
1255 ; CHECK FOR MINOR FRAME IN LOOP, GOTO STEPPING IF FOUND
; old style fre
e-
running. framing checks removed
1256 ;
033F 308FFD 1257 JNB TF1,SWT3 ;WAIT FOR small bit timer (1.0+ MSEC
TIMER total)
1258 +1 WATCHDOG
0342 75A800 1259 +1 MOV IE,#00H ;DISable all interrupts
0345 C2B2 1260 +1 CLR PCLR ;TOGGLE PCLR FOR WATCHDOG
0347 00 1261 +1 NOP
0348 00 1262 +1 NOP
0349 D2B2 1263 +1 SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
1264 +1 IF (UseInterrupt)
034B 75A884 1265 +1 MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.1
08F
1266 +1 ELSE ;IF (UseInterrupt)
1267 +1 MOV IE,#80H ;enable interrupts, but not Ext Int 1
or any other specific interrupt ;M107J87 - >
M107K87
1268 +1 ENDIF ;IF (UseInterrupt)
1270 ; MOV IE,#00H ;DISable all interrupts
1271 ; CLR PCLR
1272 ; NOP
1273 ; NOP
1274 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
1275 ; CLR EDGE
1276 ;
1277 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
1278 ;; MOV IE,#80H ;enable interrupts, but not Ext Int
1 or any other specific interrupt ;M107J87 -
>
M107K87
1279
034E C28E 1280 CLR TR1 ;STOP TIMER
0350 758DFF 1281 MOV TH1,#0FFH ;65301d ;timing dependency - ?
fixed
0353 758B15 1282 MOV TL1,#015H ;RELOAD
1283 ; 117.50, 65301,'FF15'
1284 ; For 117.500000 microSec, @ 24.0000MHz, count =
65301, FF15
1285
; old style f
ree-
running. framing checks removed
0356 2113 1286 JMP DOSTEP
1287 ;__________________________________________________________________________
_____________________________
_
1288
0358 0164 1289 JMP RESET
035A 0164 1290 JMP RESET
035C 0164 1291 JMP RESET
035E 0164 1292 JMP RESET
0360 0164 1293 JMP RESET
1294
1295 ;__________________________________________________________________________
_____________________________
_______________________________________
1296 ;Sweep look-up table in code space (ROMmed)
0400 1297 ORG 0400H
0400 1298 TABLE: ;Sersio sweep for TED using AD-7111A coded
below
1299 ;| AD IN offset AD offset AD deltaV
offset AD deltaV/V | AD IN Energy [eV] delta
E
deltaE/E
1300 ; DB 0241 ;| 0241 .9800000E-
01 .098000000 .000000000 ;
1301 ; DB 0241 ;| 0241 .9800000E-
01 .098000000 .000000000 ;
1302 ; DB 0186 ;|
0186 .1019055 .003905542 .038325120
1303 ; DB 0186 ;|
0186 .1019055 .003905542 .038325120
1304 ; DB 0170 ;|
0170 .1057926 .003887035 .036742040 ;
1305 ; DB 0170 ;|
0170 .1057926 .003887035 .036742040 ;
0400 A0 1306 DB 0160 ;|
0160 .1100000 .004207425 .038249320
0401 A0 1307 DB 0160 ;|
0160 .1100000 .004207425 .038249320
1308 ; DB 0154 ;|
0154 .1135482 .003548235 .031248700 ;
1309 ; DB 0154 ;|
0154 .1135482 .003548235 .031248700 ;
0402 94 1310 DB 0148 ;|
0148 .1181456 .004597411 .038913080
0403 94 1311 DB 0148 ;|
0148 .1181456 .004597411 .038913080
1312 ; DB 0144 ;|
0144 .1219431 .003797501 .031141570 ;
1313 ; DB 0144 ;|
0144 .1219431 .003797501 .031141570 ;
0404 8D 1314 DB 0141 ;|
0141 .1252541 .003310919 .026433620
0405 8D 1315 DB 0141 ;|
0141 .1252541 .003310919 .026433620
1316 ; DB 0137 ;|
0137 .1303915 .005137444 .039400140 ;
1317 ; DB 0137 ;|
0137 .1303915 .005137444 .039400140 ;
0406 84 1318 DB 0132 ;|
0132 .1381958 .007804334 .056473000
0407 84 1319 DB 0132 ;|
0132 .1381958 .007804334 .056473000
1320 ; DB 0128 ;|
0128 .1457729 .007577017 .051978240 ;
1321 ; DB 0128 ;|
0128 .1457729 .007577017 .051978240 ;
0408 7C 1322 DB 0124 ;|
0124 .1547782 .009005293 .058181940
0409 7C 1323 DB 0124 ;|
0124 .1547782 .009005293 .058181940
1324 ; DB 0121 ;|
0121 .1626296 .007851422 .048277940 ;
1325 ; DB 0121 ;|
0121 .1626296 .007851422 .048277940 ;
040A 76 1326 DB 0118 ;|
0118 .1715667 .008937120 .052091230
040B 76 1327 DB 0118 ;|
0118 .1715667 .008937120 .052091230
1328 ; DB 0116 ;|
0116 .1782013 .006634563 .037230730 ;
1329 ; DB 0116 ;|
0116 .1782013 .006634563 .037230730 ;
040C 72 1330 DB 0114 ;|
0114 .1854342 .007232919 .039005320
040D 72 1331 DB 0114 ;|
0114 .1854342 .007232919 .039005320
1332 ; DB 0111 ;|
0111 .1975248 .012090610 .061210590 ;
1333 ; DB 0111 ;|
0111 .1975248 .012090610 .061210590 ;
040E 6C 1334 DB 0108 ;|
0108 .2112873 .013762520 .065136510
040F 6C 1335 DB 0108 ;|
0108 .2112873 .013762520 .065136510
1336 ; DB 0105 ;|
0105 .2269529 .015665640 .069025920 ;
1337 ; DB 0105 ;|
0105 .2269529 .015665640 .069025920 ;
0410 66 1338 DB 0102 ;|
0102 .2447849 .017831920 .072847320
0411 66 1339 DB 0102 ;|
0102 .2447849 .017831920 .072847320
1340 ; DB 0100 ;|
0100 .2580226 .013237710 .051304480 ;
1341 ; DB 0100 ;|
0100 .2580226 .013237710 .051304480 ;
0412 62 1342 DB 0098 ;|
0098 .2724541 .014431540 .052968680
0413 62 1343 DB 0098 ;|
0098 .2724541 .014431540 .052968680
1344 ; DB 0096 ;|
0096 .2881872 .015733060 .054593210 ;
1345 ; DB 0096 ;|
0096 .2881872 .015733060 .054593210 ;
0414 5E 1346 DB 0094 ;|
0094 .3053391 .017151950 .056173450
0415 5E 1347 DB 0094 ;|
0094 .3053391 .017151950 .056173450
1348 ; DB 0092 ;|
0092 .3240379 .018698750 .057705450 ;
1349 ; DB 0092 ;|
0092 .3240379 .018698750 .057705450 ;
0416 59 1350 DB 0089 ;|
0089 .3552949 .031257060 .087974970
0417 59 1351 DB 0089 ;|
0089 .3552949 .031257060 .087974970
1352 ; DB 0086 ;|
0086 .3908743 .035579320 .091024990 ;
1353 ; DB 0086 ;|
0086 .3908743 .035579320 .091024990 ;
0418 54 1354 DB 0084 ;|
0084 .4172870 .026412730 .063296300
0419 54 1355 DB 0084 ;|
0084 .4172870 .026412730 .063296300
1356 ; DB 0082 ;|
0082 .4460817 .028794740 .064550360 ;
1357 ; DB 0082 ;|
0082 .4460817 .028794740 .064550360 ;
041A 50 1358 DB 0080 ;|
0080 .4774733 .031391590 .065745230
041B 50 1359 DB 0080 ;|
0080 .4774733 .031391590 .065745230
1360 ; DB 0078 ;|
0078 .5116959 .034222600 .066880740 ;
1361 ; DB 0078 ;|
0078 .5116959 .034222600 .066880740 ;
041C 4C 1362 DB 0076 ;|
0076 .5490049 .037308990 .067957480
041D 4C 1363 DB 0076 ;|
0076 .5490049 .037308990 .067957480
1364 ; DB 0074 ;|
0074 .5896785 .040673610 .068975910 ;
1365 ; DB 0074 ;|
0074 .5896785 .040673610 .068975910 ;
041E 47 1366 DB 0071 ;|
0071 .6576690 .067990480 .103381000
041F 47 1367 DB 0071 ;|
0071 .6576690 .067990480 .103381000
1368 ; DB 0069 ;|
0069 .7081425 .050473450 .071275850 ;
1369 ; DB 0069 ;|
0069 .7081425 .050473450 .071275850 ;
0420 42 1370 DB 0066 ;|
0066 .7925144 .084371920 .106461100
0421 42 1371 DB 0066 ;|
0066 .7925144 .084371920 .106461100
1372 ; DB 0064 ;|
0064 .8551488 .062634410 .073243870 ;
1373 ; DB 0064 ;|
0064 .8551488 .062634410 .073243870 ;
0422 3F 1374 DB 0063 ;|
0063 .8885534 .033404650 .037594420
0423 3F 1375 DB 0063 ;|
0063 .8885534 .033404650 .037594420
1376 ; DB 0061 ;|
0061 .9598491 .071295680 .074278000 ;
1377 ; DB 0061 ;|
0061 .9598491 .071295680 .074278000 ;
0424 3B 1378 DB 0059 ;| 0059
1.037575 .077725410 .074910680
0425 3B 1379 DB 0059 ;| 0059
1.037575 .077725410 .074910680
1380 ; DB 0057 ;| 0057
1.122310 .084735160 .075500690 ;
1381 ; DB 0057 ;| 0057
1.122310 .084735160 .075500690 ;
0426 37 1382 DB 0055 ;| 0055
1.214687 .092376830 .076049930
0427 37 1383 DB 0055 ;| 0055
1.214687 .092376830 .076049930
1384 ; DB 0052 ;| 0052
1.369105 .154418000 .112787600 ;
1385 ; DB 0052 ;| 0052
1.369105 .154418000 .112787600 ;
0428 32 1386 DB 0050 ;| 0050
1.483738 .114633900 .077260200
0429 32 1387 DB 0050 ;| 0050
1.483738 .114633900 .077260200
1388 ; DB 0048 ;| 0048
1.608711 .124972100 .077684640 ;
1389 ; DB 0048 ;| 0048
1.608711 .124972100 .077684640 ;
042A 2E 1390 DB 0046 ;| 0046
1.744953 .136242600 .078078100
042B 2E 1391 DB 0046 ;| 0046
1.744953 .136242600 .078078100
1392 ; DB 0044 ;| 0044
1.893483 .148529600 .078442570 ;
1393 ; DB 0044 ;| 0044
1.893483 .148529600 .078442570 ;
042C 2A 1394 DB 0042 ;| 0043
1.972698 .079214930 .040155630
042D 2A 1395 DB 0042 ;| 0043
1.972698 .079214930 .040155630
1396 ; DB 0041 ;| 0041
2.141766 .169068600 .078938850 ;
1397 ; DB 0041 ;| 0041
2.141766 .169068600 .078938850 ;
042E 26 1398 DB 0038 ;| 0038
2.424383 .282616900 .116572700
042F 26 1399 DB 0038 ;| 0038
2.424383 .282616900 .116572700
1400 ; DB 0036 ;| 0036
2.634187 .209803800 .079646520 ;
1401 ; DB 0036 ;| 0036
2.634187 .209803800 .079646520 ;
0430 22 1402 DB 0034 ;| 0034
2.862912 .228724700 .079892340
0431 22 1403 DB 0034 ;| 0034
2.862912 .228724700 .079892340
1404 ; DB 0032 ;| 0032
3.112264 .249352000 .080119170 ;
1405 ; DB 0032 ;| 0032
3.112264 .249352000 .080119170 ;
0432 1E 1406 DB 0030 ;| 0030
3.384104 .271839900 .080328470
0433 1E 1407 DB 0030 ;| 0030
3.384104 .271839900 .080328470
1408 ; DB 0028 ;| 0028
3.680459 .296355700 .080521400 ;
1409 ; DB 0028 ;| 0028
3.680459 .296355700 .080521400 ;
0434 1A 1410 DB 0026 ;| 0026
4.003541 .323082200 .080699100
0435 1A 1411 DB 0026 ;| 0026
4.003541 .323082200 .080699100
1412 ; DB 0025 ;| 0025
4.175850 .172308400 .041263080 ;
1413 ; DB 0025 ;| 0025
4.175850 .172308400 .041263080 ;
0436 16 1414 DB 0022 ;| 0022
4.739745 .563894700 .118971500
0437 16 1415 DB 0022 ;| 0022
4.739745 .563894700 .118971500
1416 ; DB 0020 ;| 0020
5.158358 .418613400 .081152450 ;
1417 ; DB 0020 ;| 0020
5.158358 .418613400 .081152450 ;
0438 12 1418 DB 0018 ;| 0017
5.858116 .699758100 .119451000
0439 12 1419 DB 0018 ;| 0017
5.858116 .699758100 .119451000
1420 ; DB 0015 ;| 0015
6.377589 .519473100 .081452890 ;
1421 ; DB 0015 ;| 0015
6.377589 .519473100 .081452890 ;
043A 0E 1422 DB 0014 ;| 0014
6.654639 .277049500 .041632540
043B 0E 1423 DB 0014 ;| 0014
6.654639 .277049500 .041632540
1424 ; DB 0012 ;| 0012
7.245946 .591307200 .081605240 ;
1425 ; DB 0012 ;| 0012
7.245946 .591307200 .081605240 ;
043C 0A 1426 DB 0010 ;| 0010
7.890580 .644633800 .081696630
043D 0A 1427 DB 0010 ;| 0010
7.890580 .644633800 .081696630
043E 06 1428 DB 0006 ;| 0010
7.890580 .644633800 .081696630
043F 06 1429 DB 0006 ;| 0010
7.890580 .644633800 .081696630
1430 ;| -------------------
Sersio----------------------------
1431 ;| AD IN offset AD offset AD deltaV offset AD
deltaV/V
1432
1433 ;==========================================================================
=============================
======================
1434 ;------------------------------------------------------------------------
1435 ;PARASYNC MACRO
1436 ;EOC SET ($/16)
1437 ;EOC SET (EOC+1)*16
1438 ; ORG EOC
1439 ; ENDM
1440
1441 ;WATCHDOG MACRO
;
old style free-running
1442 ; MOV IE,#00H ;DISable all interrupts
1443 ; CLR PCLR ;TOGGLE PCLR FOR WATCHDOG
1444 ; NOP
1445 ; NOP
1446 ; SETB PCLR ;TOGGLE PCLR FOR WATCHDOG
1447 ; MOV IE,#84H ;enable interrupts, and Ext Int 1
;v1.108E -> v1.
108F
1448 ; ENDM
1449
1450
1451 ; PARASYNC
0044 1452 EOC SET ($/16)
0450 1453 EOC SET (EOC+1)*16
0450 1454 ORG EOC
0450 1455 ROM_ID:
0450 4B383720 1456 DB 'K87 CPU PROM VER: MICA 1.108G for Bagel; '
0454 43505520
0458 50524F4D
045C 20564552
0460 3A204D49
0464 43412031
0468 2E313038
046C 4720666F
0470 72204261
0474 67656C3B
0478 2020
1457
1458
1459 ; PARASYNC
0047 1460 EOC SET ($/16)
0480 1461 EOC SET (EOC+1)*16
0480 1462 ORG EOC
0480 1463 SWEEPDATA:
0480 42616765 1464 DB 'Bagel '
0484 6C202020
0488 20
1465
0489 1466 OPTIONS:
1467
1468
1469 ; PARASYNC
0048 1470 EOC SET ($/16)
0490 1471 EOC SET (EOC+1)*16
0490 1472 ORG EOC
1473 IF (BagelEveryOtherStep) ;v1.107S -> 1.107U
1474 DB 'Using every OTHER step in table '
1475 ELSE ;IF (BagelEveryOtherStep)
0490 5573696E 1476 DB 'Using ALL steps in table '
0494 6720414C
0498 4C207374
049C 65707320
04A0 696E2074
04A4 61626C65
04A8 20
1477 ENDIF ;IF (BagelEveryOtherStep)
1478
1479
1480
1481 ; PARASYNC
004A 1482 EOC SET ($/16)
04B0 1483 EOC SET (EOC+1)*16
04B0 1484 ORG EOC
1485 IF (DBLCOUNTGUARDN) ;v1.107F -> 1.107G
1486 DB 'Guarding against double counting MinF pulses '
1487 ELSE ;IF (DBLCOUNTGUARDN)
04B0 4E4F2047 1488 DB 'NO Guarding against double counting MinF
pulses '
04B4 75617264
04B8 696E6720
04BC 61676169
04C0 6E737420
04C4 646F7562
04C8 6C652063
04CC 6F756E74
04D0 696E6720
04D4 4D696E46
04D8 2070756C
04DC 73657320
1489 ENDIF ;IF (DBLCOUNTGUARDN)
1490
1491
1492 ; PARASYNC
004E 1493 EOC SET ($/16)
04F0 1494 EOC SET (EOC+1)*16
04F0 1495 ORG EOC
1496 IF (DO_MAJF) ;v1.107P -> 1.107S
1497 DB 'Processing MajF pulses '
1498 ELSE ;IF (DO_MAJF)
04F0 4E4F5420 1499 DB 'NOT Processing MajF pulses '
04F4 50726F63
04F8 65737369
04FC 6E67204D
0500 616A4620
0504 70756C73
0508 657320
1500 ENDIF ;IF (DO_MAJF)
1501
1502
1503 ; PARASYNC
0050 1504 EOC SET ($/16)
0510 1505 EOC SET (EOC+1)*16
0510 1506 ORG EOC
1507 IF (DBLCOUNTGUARDJ) ;v1.107F -> 1.107G
1508 DB 'Guarding against double counting MajF pulses '
1509 ELSE ;IF (DBLCOUNTGUARDJ)
0510 4E4F2047 1510 DB 'NO Guarding against double counting pulses '
0514 75617264
0518 696E6720
051C 61676169
0520 6E737420
0524 646F7562
0528 6C652063
052C 6F756E74
0530 696E6720
0534 70756C73
0538 657320
1511 ENDIF ;IF (DBLCOUNTGUARDJ)
1512
1513
1514 ; PARASYNC
0053 1515 EOC SET ($/16)
0540 1516 EOC SET (EOC+1)*16
0540 1517 ORG EOC
1518 IF (SyncCount=128)
1519 DB 'Restart sweep every 128 MajFs '
1520 ELSE ;IF (SyncCount=128)
1521 IF (SyncCount=64)
1522 DB 'Restart sweep every 64 MajFs '
1523 ELSE ;IF (SyncCount=64)
1524 IF (SyncCount<>0)
1525 DB 'Restart sweep every N MajFs '
1526 ELSE ;IF (SyncCount<>0)
0540 446F204E 1527 DB 'Do NOT Restart sweep every N MajFs '
0544 4F542052
0548 65737461
054C 72742073
0550 77656570
0554 20657665
0558 7279204E
055C 204D616A
0560 467320
1528 ENDIF ;IF (SyncCount<>0)
1529 ENDIF ;IF (SyncCount=64)
1530 ENDIF ;IF (SyncCount=128)
1531
1532
1533 ; PARASYNC
0056 1534 EOC SET ($/16)
0570 1535 EOC SET (EOC+1)*16
0570 1536 ORG EOC
1537 IF (WORKAROUND) ;v1.107P -> 1.107S
1538 DB 'WORKAROUND for MinF pulse counting ; '
1539 ELSE
0570 4E4F2077 1540 DB 'NO workaround for MinF pulse counting; '
0574 6F726B61
0578 726F756E
057C 6420666F
0580 72204D69
0584 6E462070
0588 756C7365
058C 20636F75
0590 6E74696E
0594 673B2020
1541 ENDIF ;IF (WORKAROUND)
1542
1543
1544
1545 ; PARASYNC
0059 1546 EOC SET ($/16)
05A0 1547 EOC SET (EOC+1)*16
05A0 1548 ORG EOC
1549 IF (SYNC1PPS)
1550 DB 'force energy sweep to reset at 1PPS; '
1551 ELSE
05A0 4E4F5F53 1552 DB 'NO_SYNC1PPS; '
05A4 594E4331
05A8 5050533B
05AC 2020
1553 ENDIF ;IF (SYNC1PPS)
1554
1555
1556
1557 ; PARASYNC
005A 1558 EOC SET ($/16)
05B0 1559 EOC SET (EOC+1)*16
05B0 1560 ORG EOC
1561 IF (OLDSTYLE)
05B0 4F4C4453 1562 DB 'OLDSTYLE ack handling; '
05B4 54594C45
05B8 2061636B
05BC 2068616E
05C0 646C696E
05C4 673B2020
1563 ELSE ;IF (OLDSTYLE)
1564 IF (NEWSTYLE)
1565 DB 'NEWSTYLE ack handling; '
1566 ELSE ;IF (NEWSTYLE)
1567 DB 'NOT_OLDSTYLE ack handling; '
1568 ENDIF ;IF (NEWSTYLE)
1569 ENDIF ;IF (OLDSTYLE)
1570
1571
1572
1573 ; PARASYNC
005C 1574 EOC SET ($/16)
05D0 1575 EOC SET (EOC+1)*16
05D0 1576 ORG EOC
1577 IF (FALLBACK) ;v1.107P -> 1.107S
1578 DB 'FallBack to Free Running if sync pulses stop ;
'
1579 ELSE
05D0 4672616D 1580 DB 'Frame Syncing ONLY; '
05D4 65205379
05D8 6E63696E
05DC 67204F4E
05E0 4C593B20
05E4 20
1581 ENDIF ;IF (FALLBACK)
1582
1583
1584 ; PARASYNC
005E 1585 EOC SET ($/16)
05F0 1586 EOC SET (EOC+1)*16
05F0 1587 ORG EOC
1588 IF (NOFRAMES)
1589 DB 'Free Running ONLY; '
1590 ELSE
05F0 4672616D 1591 DB 'Frame Syncing; '
05F4 65205379
05F8 6E63696E
05FC 673B2020
1592 ENDIF ;IF (INCLUDECAL)
1593
1594
1595
1596
1597 ; PARASYNC
0060 1598 EOC SET ($/16)
0610 1599 EOC SET (EOC+1)*16
0610 1600 ORG EOC
1601 IF (INCLUDECAL)
0610 494E434C 1602 DB 'INCLUDECAL; '
0614 55444543
0618 414C3B20
061C 20
1603 ELSE
1604 DB 'NOT_INCLUDECAL; '
1605 ENDIF ;IF (INCLUDECAL)
1606
1607 ;
1608 ;--------------------------------------------------------------------------
-----------------------------
----------------------
1609 ;* 8051 timing calculator (v0.3, June 17, 2011)
1610 ;*
1611 ; program time8051
1612 ; integer i,count
1613 ; real clock,time,rcount,period
1614 ;*------
1615 ;* clock frequency in MHz
1616 ;* time in microSec
1617 ;*
1618 ; time = 0.0
1619 ; open
(unit=11,file='time8051.log',status='unknown',
1620 ; & access='append')
1621 ; clock = 24.0
1622 ; print *,' present clock = ',clock,' New clock
= ?'
1623 ; read (*,7002) time
1624 ; if (time.gt.0.0) then
1625 ; if (time.lt.200.0) then
1626 ; clock = time
1627 ; else
1628 ; endif
1629 ; endif
1630 ; print *,' clock = ',clock
1631 ; period = 12.0/clock
1632 ; if (time.le.0.0) time = 500.0
1633 ; 9000 continue
1634 ; rcount = time/period
1635 ; if (rcount.gt.65536.0) then
1636 ; write (*,7003) time,clock
1637 ; write (11,7003) time,clock
1638 ; else
1639 ; count = 65536 - rcount
1640 ; write (*,7001) time,clock,count,count
1641 ; write (11,7001) time,clock,count,count
1642 ; endif
1643 ; print *,' New time = ?'
1644 ; read (*,7002) time
1645 ; if (time.le.0.0) stop ' Bye'
1646 ; goto 9000
1647 ;*-----
1648 ; 7001 format(' For ',f12.6,' microSec, @ ',f12.4,'MHz,
count = ',i6.5,
1649 ; & ', ',z4)
1650 ; 7002 format(BZ,f12.0)
1651 ; 7003 format(' Time ',f12.3,' too long for single 16
bit counter@ ',
1652 ; & f12.3,'MHz')
1653 ; end
1654 ;--------------------------------------------------------------------------
-----------------------------
---------------------------
1655 ;
1656 ;For 500.000000 microSec, @ 24.0000MHz, count =
64536, FC18
1657 ;For 1.000000 microSec, @ 24.0000MHz, count =
65534, FFFE
1658 ;For 2.000000 microSec, @ 24.0000MHz, count =
65532, FFFC
1659 ;For 107.000000 microSec, @ 24.0000MHz, count =
65322, FF2A
1660 ;For 107.500000 microSec, @ 24.0000MHz, count =
65321, FF29
1661 ;For 108.000000 microSec, @ 24.0000MHz, count =
65320, FF28
1662 ;For 108.500000 microSec, @ 24.0000MHz, count =
65319, FF27
1663 ;For 109.000000 microSec, @ 24.0000MHz, count =
65318, FF26
1664 ;For 109.500000 microSec, @ 24.0000MHz, count =
65317, FF25
1665 ;For 110.000000 microSec, @ 24.0000MHz, count =
65316, FF24
1666 ;For 250.000000 microSec, @ 24.0000MHz, count =
65036, FE0C
1667 ;For 500.000000 microSec, @ 24.0000MHz, count =
64536, FC18
1668 ;For 750.000000 microSec, @ 24.0000MHz, count =
64036, FA24
1669 ;For 1000.000000 microSec, @ 24.0000MHz, count =
63536, F830
1670 ;For 1234.000000 microSec, @ 24.0000MHz, count =
63068, F65C
1671 ;For 1500.000000 microSec, @ 24.0000MHz, count =
62536, F448
1672 ;For 2000.000000 microSec, @ 24.0000MHz, count =
61536, F060
1673 ;For 2345.000000 microSec, @ 24.0000MHz, count =
60846, EDAE
1674 ;For 3456.000000 microSec, @ 24.0000MHz, count =
58624, E500
1675 ;For 3300.000000 microSec, @ 24.0000MHz, count =
58936, E638
1676 ;For 20000.000000 microSec, @ 24.0000MHz, count =
25536, 63C0
1677 ;For 30000.000000 microSec, @ 24.0000MHz, count =
05536, 15A0
1678 ;For 32000.000000 microSec, @ 24.0000MHz, count =
01536, 0600
1679 ;For 15.000000 microSec, @ 24.0000MHz, count =
65506, FFE2
1680 ;For 16.000000 microSec, @ 24.0000MHz, count =
65504, FFE0
1681 ;For 20.000000 microSec, @ 24.0000MHz, count =
65496, FFD8
1682 ;For 21.000000 microSec, @ 24.0000MHz, count =
65494, FFD6
1683 ;For 22.000000 microSec, @ 24.0000MHz, count =
65492, FFD4
1684 ;For 23.000000 microSec, @ 24.0000MHz, count =
65490, FFD2
1685 ;For 24.000000 microSec, @ 24.0000MHz, count =
65488, FFD0
1686 ;For 30.000000 microSec, @ 24.0000MHz, count =
65476, FFC4
1687 ;For 31.000000 microSec, @ 24.0000MHz, count =
65474, FFC2
1688 ;For 32.000000 microSec, @ 24.0000MHz, count =
65472, FFC0
1689 ;For 33.000000 microSec, @ 24.0000MHz, count =
65470, FFBE
1690 ;For 34.000000 microSec, @ 24.0000MHz, count =
65468, FFBC
1691 ;For 35.000000 microSec, @ 24.0000MHz, count =
65466, FFBA
1692 ;For 36.000000 microSec, @ 24.0000MHz, count =
65464, FFB8
1693 ;For 40.000000 microSec, @ 24.0000MHz, count =
65456, FFB0
1694 ;For 50.000000 microSec, @ 24.0000MHz, count =
65436, FF9C
1695 ;For 60.000000 microSec, @ 24.0000MHz, count =
65416, FF88
1696 ;For 70.000000 microSec, @ 24.0000MHz, count =
65396, FF74
1697 ;For 80.000000 microSec, @ 24.0000MHz, count =
65376, FF60
1698 ;For 90.000000 microSec, @ 24.0000MHz, count =
65356, FF4C
1699 ;For 109.000000 microSec, @ 24.0000MHz, count =
65318, FF26
1700 ;For 109.500000 microSec, @ 24.0000MHz, count =
65317, FF25
1701 ;For 110.000000 microSec, @ 24.0000MHz, count =
65316, FF24
1702 ;For 500.000000 microSec, @ 24.0000MHz, count =
64536, FC18
1703 ;For 1000.000000 microSec, @ 24.0000MHz, count =
63536, F830
1704 ;For 1234.000000 microSec, @ 24.0000MHz, count =
63068, F65C
1705 ;For 1500.000000 microSec, @ 24.0000MHz, count =
62536, F448
1706 ;For 2000.000000 microSec, @ 24.0000MHz, count =
61536, F060
1707 ;For 2345.000000 microSec, @ 24.0000MHz, count =
60846, EDAE
1708 ;For 2345.000000 microSec, @ 24.0000MHz, count =
60846, EDAE
1709 ;For 3300.000000 microSec, @ 24.0000MHz, count =
58936, E638
1710 ;For 3456.000000 microSec, @ 24.0000MHz, count =
58624, E500
1711 ;For 3300.000000 microSec, @ 24.0000MHz, count =
58936, E638
1712 ;For 20000.000000 microSec, @ 24.0000MHz, count =
25536, 63C0
1713 ;For 30000.000000 microSec, @ 24.0000MHz, count =
05536, 15A0
1714 ;For 32000.000000 microSec, @ 24.0000MHz, count =
01536, 0600
1715 ;For 32750.000000 microSec, @ 24.0000MHz, count =
00036, 0024
1716 ;For 32752.000000 microSec, @ 24.0000MHz, count =
00032, 0020
1717 ;For 32753.000000 microSec, @ 24.0000MHz, count =
00030, 001E
1718 ;For 32754.000000 microSec, @ 24.0000MHz, count =
00028, 001C
1719 ;For 32760.000000 microSec, @ 24.0000MHz, count =
00016, 0010
1720
1721 END