------------------------------------------------ -- The parallell output A/D converter is connected -- through pins pa_cspin, pa_rdpin and pa_intpin -- (though pa_intpin is represented with a mask -- pa_intmask). -- Furthermore, there are three adress pins, starting -- at pa_apin, through which the desired analog input -- channel can be selected. -- -- The data output from the converter are supposed -- to be connected to pihs 0 .. 7 on the computer. -- -- pa_logg samples pa_n data with sampling interval -- pa_ts from input channel pa_ch1, and puts them in -- global memory, starting at pa_adress. (pa_adress -- is an absolute byte adress to global memory) -- -- in case pa_dual is set, every 2nd sample is -- taken from pa_ch2. -- ---------------------------------------------------- -- -- The system is initialized once after power up -- with pa.init or pa.inits (which is for a standard -- configuration). -- -- Logging is made by first calling pa.reset and then -- a single call to pa.logg. pa.logg will return -- after the complete logg has been made. From then -- pa.reset and pa.logg can be called again. -- ----------------------------------------------------- fields pa_n pa_ts pa_adress pa_startadress pa_ch1 pa_ch2 pa_dual pa_apin pa_amask pa_intmask pa_rdpin pa_cspin pa_csrdmask pa_zcsmask pa_zrdmask endfields --------------------------------------------------- -- ( n , adress , apin , intpin , rdpin , cspin , )pa.init --------------------------------------------------- function pa.init rdmask csmask begin 0>pa_n par <<2 +arg1 ->pa_startadress 2>pa_apin 7 <pa_amask 1 <pa_intmask 4>pa_rdpin 5>cspin ( pa_rdpin )setout ( pa_cspin )setout ( pa_mask )setdir 1 <rdmask 1 <csmask csmask |rdmask ->pa_csrdmask rdmask Xallones ->pa_zrdmask csmask Xallones ->pa_zcsmask return load from (std.mpo) *setout *setdir ------------------------------------------ -- ( n , adress , )pa_inits ------------------------------------------ function pa.inits csmask rdmask begin 0>pa_n par <<2 +arg1 ->pa_startadress 11 ->pa_apin 7 <pa_amask 1 <<8 ->pa_intmask 9 ->pa_rdpin 10 ->pa_cspin ( pa_rdpin )setout ( pa_cspin )setout ( pa_amask )setdir 1 <rdmask 1 <csmask csmask |rdmask ->pa_csrdmask rdmask Xallones ->pa_zrdmask csmask Xallones ->pa_zcsmask return load from (std.mpo) *setout *setdir ---------------------------------------- -- ( ts , ch1 , ch2 , dual , )pa.reset ---------------------------------------- function pa.reset begin 0>pa_ts arg1 <pa_ch1 arg2 <pa_ch2 ( pa_ch1 , pa_amask , )outpins 3>pa_dual pa_startadress ->pa_adress return load from (std.mpo) *outpins --------------------------------------- -- )pa.logg --------------------------------------- function pa.logg -pal channel=0 k begin pa_n ->k :loop dual F:nondual if(channel =0){( pa_ch1 , pa_amask , )outpins } if(channel #0){( pa_ch2 , pa_amask , )outpins } channel X1 ->channel :nondual &pa_zcsmask,outa< 0 &pa_zrdmask,outa< ( pa_intmask )waitfor0 ina ; wrbyte accu,pa_adress +1,pa_adress< if(pa_ts #0){ pa_ts wait } |pa_csrdmask,outa< NEXT(k):loop return load from(std.mpo) *waitfor0 ----------------------------------------------------- -- This is the digital logg. It takes data directly -- from bits 16 .. 20. -- It requires initalization from pa.init(s) and -- pa.reset ----------------------------------------------------- function pd.logg -pdl k begin pa_n ->k :loop ina >>16 &31 ; wrbyte accu,pa_adress +1,pa_adress< if(pa_ts #0){ pa_ts wait } NEXT(k):loop return