On Fri, 26 Apr 2013 15:39:27 -0500, Morris Dovey <
mrd...@iedu.com>
wrote:
>I wish I�d known that you needed an SPI driver because I have C code
>here (written to talk to an X25650 EEPROM) that would have been fairly
>easy for you to rework to suit your needs.
Thanks Morris.
What I needed is somewhat specialized. I'm sampling an analog signal
at 1 megasample/sec using an Analog Devices SPI A/D converter. The
SPI clock is the sample trigger so it has to be precisely on frequency
and of low jitter. If not, the FFT that follows is all over the
place.
The SPI driver that comes with the board runs at a low priority and
the preempting causes as much as half a clock cycle jitter. Totally
unsatisfactory.
I worked on the problem for a couple of weeks, time lost to the
product design, when I reminded myself that I'm a EE and not a kernel
hacker. I found a guy in England who is a kernel expert and did the
driver in just a few hours. We took a very simple approach. The size
buffer is programmed with an IOCTL call. The buffer is in kernel
space. When the call to take a sample is made, everything else is
preempted while the driver runs the port for the designated number of
samples.
There is still some clock jitter resulting from phase-locking a (I
think)24 MHz crystal up to 700MHz and then back down to the 48 MHz SPI
clock. But the FFT smear is tolerable for this application.
The important point I wanted to make is that the BeagleBone is not
souped up Arduino as it's being called. It's only for Linux experts
(or those who want to be) and certainly not for someone inexperienced
in Linux internals who is just trying to get a project done.
I could write many more paragraphs but I'll stop here. The only
reason I've stuck with it is that I need the raw speed and the
built-in "neon" DSP instructions.