From owner-freebsd-hackers Sat Nov 15 11:27:51 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA26502 for hackers-outgoing; Sat, 15 Nov 1997 11:27:51 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from trojanhorse.ml.org (mdean.vip.best.com [206.86.94.101]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA26496 for ; Sat, 15 Nov 1997 11:27:48 -0800 (PST) (envelope-from jamil@trojanhorse.ml.org) Received: from localhost (jamil@localhost) by trojanhorse.ml.org (8.8.8/8.8.5) with SMTP id LAA04702; Sat, 15 Nov 1997 11:27:38 -0800 (PST) Date: Sat, 15 Nov 1997 11:27:38 -0800 (PST) From: "Jamil J. Weatherbee" Reply-To: "Jamil J. Weatherbee" To: freebsd-hackers@freebsd.org cc: dufault@hda.com Subject: AIO8-P/AT16-P Analog Driver Complete (Major Number Requested) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk A truly reasonably priced analog input board. I am now officially requesting a major number (I see that the teletype driver got one within a week, which makes me wonder why my previos Digital I/O driver was not taken seriously at all). However I have spent a considerable amount of time on an analog input board driver. This board is intended to be used with an accessory multiplexer (not required). The per channel cost is about $26, and can be expanded to 128 channels, all channels are 12-bit. I have included the manual page below for your viewing pleasure: AIOX(4) FreeBSD Kernel Interfaces Manual (i386 Architecture) AIOX(4) NAME aiox - Industrial Computer Source AIO8-P driver SYNOPSIS device aiox0 at isa? port 0x260 tty irq 5 vector aioxintr DESCRIPTION This driver supports the Industrial Computer Source AIO8-P 8-Channel 12-Bit Analog Input board. This board provides 8 12 bit, single-ended analog input ports. The driv- er also directly provides support for up to 8 daisy chained AT16-P Pro- grammable Analog Multiplexers with 16 Differential Inputs. This makes it possible to sample up to 128 differential channels with a single inter- face board. Use of at least one AT16-P is highly recommended as the AIO8-P offers no signal conditioning options and only operates in a -5 to +5 Volt input range. However, if you wish to use the AIO8-P standalone, insert the following into your kernel config(8) file: options AIOX_CHANNELS=8 Selection of the input port is through the minor number: The 9 bit minor number format is UUCCCCMMM, where UU: board unit (0-3) CCCC: external multiplexer channel (0-15) (on AT-16P units) MMM: internal multiplexer channel (0-7) (on AIO8-P card) devfs(5) device node names are of the form: aiox[0-3][a-p][0-7] IOCTL The following ioctl(2) calls apply to aiox devices. Their declaration can be found in the header files and AD_MICRO_PERIOD_SET Takes a pointer to a long argument specifying the number of microseconds between samples. Half of this is used as the external multiplexer settling time and the other half as conversion time. AD_MICRO_PERIOD_GET Takes a pointer to a long argument and returns the current number of microseconds between samples. AD_START Starts the clocked accumulation of sample values in- to a channels driver fifo. When a channel is first opened its software fifo is initialized in the stopped state. This is to prevent high sample clocks from overrunning the fifos before the user is ready to read from the channel. AD_STOP Stops the clocked accumulation of sample values into a channels driver fifo. BUGS On the AIO8-P, interrupt driven conversion (the only type supported by the aiox driver) is facilitated through 8253 timer #2. In order for in- terrrupts to be generated you must connect line 6 to line 24 (counter 2 output to interrupt input) and line 23 to line 29 (counter 2 gate to +5VDC). Due to the design of the AIO8-P this precludes the use of pro- grammable gain control. A 64 entry (128 byte) software fifo is provided for each analog channel. Reads are non-blocking on the aiox driver, so providing a read(2) buffer channels. Using this method, multichannel sample rates as high as 16,000 samples/sec have been observed. Sample rates lower than 32 Hz are not supported. SEE ALSO http://www.indcompsrc.com/products/data/html/aio8g-p.html http://www.indcompsrc.com/products/data/html/at16-p.html AUTHOR Jamil J. Weatherbee . FreeBSD November 14, 1997 2