2000-04-03

EA Mag Pocket Sampler

picture of the unit

A simple Linux kernel module to drive the August 1996 EA Pocket Sampler.

Kit Documentation

Some time ago (1999-05-11) Max Lock emailed me about the driver and hardware unit, he was kind enough to email me some PDFs of the kit plans. These are a little more modern than mine, this unit has a precision voltage reference and requires no calibration, identical ADC hardware though.


A Picture of the Hardware

picture inside the unit

Talking To It

A simple Linux char device driver was written to talk to the device. It implements:

It honours O_NONBLOCK and is concurrent read() safe. It should compile on Linux 1.2.13 and later, including 2.0.3x and 2.2.1x. It may need modification for the very latest kernels, Linux is a moving target.

The User/Kernel Protocol

read(): Returns text, a line of 4 integers. The first two are the sample time, epoch seconds, and microseconds (from do_gettimeofday()). The third is the level switch position for that sample (2 or 20 volts). The forth is the raw sample; 0-255.

In single shot mode (see below), a single sample is returned on read(), later reads on the same file descriptor will return 0 bytes readable. In periodic sampling mode, a blocking read() will occur, making the device node appear like a pipe.

write(): writing to the device controls the sampling interval. An integer in plain text is written to the device to change the sampling period. A zero will yield single shot mode, any other value will cause a sample to be taken every 100ms times that value. The default initial value is zero, or single shot mode.

open(), select(), and close() work as expected.

The code is here: eapsampler-2.0.tar.gz

Leave a comment on this article.