linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Kinar <n.kinar-/KKvz3x1pcI@public.gmane.org>
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Embedded system control loops and reading from daisy-chained ADCs
Date: Wed, 12 Jan 2011 10:45:18 -0600	[thread overview]
Message-ID: <4D2DDA9E.4090504@usask.ca> (raw)

Hello,

I am in the process of designing an embedded system that needs to read 
values over SPI from 5 daisy-chained ADCs.  The ADCs are the AD7685 from 
Analog Devices 
(http://www.analog.com/en/analog-to-digital-converters/ad-converters/ad7685/products/product.html).  
These are 16-bit ADC slave devices that are read over a SPI bus.  I 
would like to read these devices at a rate of 1 kHz.  I am using the ARM 
AT91SAM9RL processor.  This processor will run the Linux kernel.

To read values from these ADCs, the processor must first toggle a port 
pin (CNV) to initiate a conversion.  The processor needs to toggle the 
port pin at a rate of 1 kHz, perhaps using a high-resolution timer.  
After every conversion, the processor needs to lower a chip select pin 
and read data consisting of a (16 bit)(5) =  80-bit word.  The chip 
select pin then goes high.  I assume that the daisy-chained ADCs would 
appear to the kernel driver as a single SPI slave with MISO, MOSI, and 
\CS pins.  The only difference is the CNV pin that is needed to initiate 
a conversion.

After every conversion, the kernel driver needs to make a comparison (is 
the value from each ADC above or below a certain value).  The kernel 
driver needs to then select an SPI slave DAC (AD5621) or I2C slave DAC 
(AD5622) and update the voltage output of the DAC.

I need to read data from the ADC slaves at a rate of 1 kHz.  What is the 
best way to do this without introducing too much jitter, and is it 
possible to do this all with one kernel driver?

Nicholas


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl

             reply	other threads:[~2011-01-12 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12 16:45 Nicholas Kinar [this message]
     [not found] ` <4D2DDA9E.4090504-/KKvz3x1pcI@public.gmane.org>
2011-01-13  2:33   ` Embedded system control loops and reading from daisy-chained ADCs Ned Forrester
     [not found]     ` <4D2E646E.40505-/d+BM93fTQY@public.gmane.org>
2011-01-13 16:00       ` Nicholas Kinar
     [not found]         ` <4D2F219A.1090601-/KKvz3x1pcI@public.gmane.org>
2011-01-14  4:43           ` Ned Forrester
     [not found]             ` <4D2FD480.4020001-/d+BM93fTQY@public.gmane.org>
2011-01-14  5:01               ` Nicholas Kinar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D2DDA9E.4090504@usask.ca \
    --to=n.kinar-/kkvz3x1pci@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).