Hardware Reference
In-Depth Information
INPUT "Enter ambient temperature: "; temp$
osc$ = ref$ + temp$
REM Initialise digital frequency meter
OPEN "GT200$" FOR OUTPUT AS #1
OPEN "GT200$" FOR INPUT AS #2
PRINT #1, "init; timeout 4; function frequency A; gate 0.2"
REM Start collecting readings
PRINT "Hit (RETURN) to start measurement..."
WHILE r$ = ""
r$ = INKEY$
WEND
FOR time%=0TO99
PRINT #1, "reset"
' INPUT #2, freq(time%)
PRINT "Time = "; 10 * time%; " sec. Frequency = ";
freq(time%); " Hz"
PRINT #1, "wait 10"
NEXT time%
CLOSE #1
CLOSE #2
REM Calculate and print statistics
PRINT
PRINT "Performance data for oscillator ref: "; ref$
PRINT
PRINT "Performance measured at: "; temp$; " deg.C"
max
PRINT "Maximum frequency; "; maxfreq; " Hz"
min
PRINT "Minimum frequency: "; minfreq; " Hz"
mean
PRINT "Mean frequency: "; meanfreq; " Hz"
PRINT "Frequency drift: "; maxfreq - minfreq; " Hz"
PRINT
REM Save data in an ASCII file
LET file$ = osc$ + ".DAT"
OPEN file$ FOR OUTPUT AS #3
FOR time%=0TO99
PRINT #3, freq(time%)
NEXT time%
CLOSE #3
END
SUB max
SHARED freq()
SHARED maxfreq
maxfreq = 0
FORi%=0TO99
IF freq(i%) > maxfreq THEN maxfreq = freq(i%)
NEXT i%
END SUB
Search WWH ::




Custom Search