'This
software accesses the DAQCard-500 on the PCMCIA slot.
'
'The
Card base memory address is segment 000C, offset 0000.
'
'The
card is located in I/O space at 0120 - 013F.
'Address: Register:
'-------- ---------
cr1 =
&h120 'Command Register 1
cr2 =
&h127 'Command Register 2
sr1 =
&h120 'Status Register 1
sr2 =
&h121 'Status Register 2
admsb =
&h123 'a/d msb
adlsb =
&h122 'a/d lsb
adcr =
&h121 'a/d clear
ctr0 =
&h128 'Counter 0
ctr1 =
&h129 'Counter 1
ctr2 =
&h12a 'Counter 2
cmr =
&h12b 'Counter mode
ticr =
&h126 'Timer int. clear
dout =
&h124 'Digital output
din =
&h125 'Digital input
'
'------------------------------------
cls
out
cr1,128 'init DAQCard, a/d chan 0, no
interrupts
out
cr2,0
out
ticr,0
out
adcr,0
out
cmr,52 'load counter with sequential
writes
'counter
0 provides the continuous conversion clock
'the
clock counts down the 16 bit counter and toggles start convert
'the
time is based on a 1 MHZ clock cycle = 1 usec
' 250 *
1 = 250 usec per conversion = 4000 per
sec.
out
ctr0,250 'sample interval lsb n * 1 usec
out
ctr0,0 'sample interval msb n * 256 usec
open
"a:/logdata.dat" for output as #2
start:
print
#2, time$
for s =
0 to 1023
print
#2, s, inp(admsb), inp(adlsb)
next s
print
#2, time$
cls
print
"done"