This is a driver for the Spectrometer S2000 from Ocean-Optics connected to a
ADC-500 A/D-Card. This driver  works only with S2000, and NOT with S1000. 
The driver currently doesn't support external Trigger/Sync.

For more information have a look at: 

http://wpfd25.physik.uni-wuerzburg.de/~karrer/s2000/s2000.html
http://www.oceanoptics.com

Installation:

make 
make install
/sbin/insmod adc5drv.o adc_iobase=0x300 adc_irq=7;

MDW NOTE: Make sure the IRQ is free! As of Sept 16, 1999, IRQ 7 is NOT free on 
meteorite.frc

Then type: tail /var/log/messages, to see if everything succeeded.
I get the following:

Oct  1 17:53:51 wpfdb7 kernel: initialized ADC-500 nr 0
Oct  1 17:53:51 wpfdb7 kernel: found 8254, card seems to be present at 0x360
Oct  1 17:53:52 wpfdb7 kernel: triggering interrupt 5 succeeded

For installation of the BLT/Tk-Extension for displaying the data
see README.BLT 

usage:

Set integration time in milliseconds:
-------------------------------------
echo 50 > /dev/adc500  

(5 - 65535)
The default is 333 ms
If integration time is lower than 1/30 second,
a pause will be inserted after the aquisition.

Set number of added frames:
---------------------------
echo add 10 > /dev/adc500

The default is 1

Stop/Start spectrometer:
-------------------------
echo stop > /dev/adc500
echo start > /dev/adc500

Per default the spectrometer is running
continuously. With long integration time it
requires nearly no CPU-Time.

Get spectrum:
-------------
cat /dev/adc500
or in gnuplot:
plot "/dev/adc500"

If the spectrometer is stopped you have to 
wait forever.

Select Channel
--------------
If you have more than one spectrometer
connected to the adc500 you can select
the channel with:

echo channel 3 > /dev/adc500

Get Status:
-----------
cat /dev/adc500_status
I get the following:

S2000/ADC-500 Board 0 Status:
---------------------------------
IO-Baseaddress:      0x360
Interrupt:           5
received Interrupts: 1198
Integration Time:    333 ms
Frames to add:       1
active channel:      0


Switch to binary/ascii mode:
---------------------------
For fast C-Programms you can use binary mode.
write the string "bin\n" or "ascii\n" to the open devicefile.
The setting is only valid for this filedescriptor.
The default on open is ascii mode.  
The dataformat in binary mode is unsigned int (32 Bit)

EOF:
----
The devicedriver delivers an EOF after every spectrum. 
If you continue reading after EOF, you will get the next
spectrum from the buffer in the device driver. 

LSEEK:
-----
If you call lseek(SEEK_SET) all data currently in the
buffer of the devicedriver will be ignored. The fifo
on the A/D-Card will not be cleared. As soon as the
A/D - Card has new data you can read() again. 

SELECT:
-------
The driver supports select(), so you can do nonblocking IO.

MAJOR DEVICENUMBER:
-------------------
The major devicenumber for the adc500 is currently 60.
This number is for experimental use.


Jochen Karrer
