Hi,
charliem_1216 <> [20080623 18:53:20 -0000]:
>
> --- In Alexander Clouter <> wrote:
>
> > I'm now starting to look at how best to deal with the ADC/AVR McWhatsit
> > and how to present this to the user; mainly as it's the next most
> > interesting thing to add support for next.
>
> Most full-blown A/D cards in linux have drivers that conform to the comedi
> interface, but that may be a little over-engineered for an embedded system
> with only an A/D, no gain settings, etc. But it may be worth a look, if
> only to get interface ideas: http://www.comedi.org/
>
> This topic (where to place increasingly common non-sensor A/D) has
> recently come up on LKML too. May be worth a look for future direction:
> http://marc.info/?l=linux-kernel&m=121127840626414&w=2
> See especially here, regarding the work already done by the
> handhelds.org guys on this:
> http://marc.info/?l=linux-kernel&m=121190685900869&w=2
>
aww man, a new subsystem... :-/ Looks like I'll be writing a standalone type
driver lurking in the wrong place like 'hwmon' and then 'porting' it to the
new subsystem later on. Well fun fun fun...
Cheers for the pointers, I'll put on my Soothsayer's cap and start thinking
of a sensible userspace interface to try.
> Finally, take a look at Phil's MAX197 driver for some interface ideas
> (in the file area of the group).
>
I think I need a Yahoo account for that one, I opted for just to slap my
email address in there and skip all the Yahoo registration malarkey.
> > * when you turn off the 'record' flag the /dev input will finish
> > gracefully
> > with the last batch(es) of data followed by an EOF or something
> > * what to do if the user does not pull the data fast enough.
> > Should I dump
> > the data to get lost in the ether, store in a buffer in kernel land
> > until the user gets around to their job (how large should I let the
> > buffer grow?). Again as we are not talking about a lot of data we
> > could probably happily store ten seconds worth of sampling and still
> > sit less than 64kiB?
>
> Circular buffer, size set by module load parameter?
>
Well now the kernel gods have provisioned us with krealloc()[1] we could make
it runtime tweakable via sysfs. I'm thinking what the best way would be to
get the information to the user that data has gotten lost...maybe this is
where the timestamps can come into play. Fortunately the ADC quality is only
10bit, three bits needed for stating which channel is being sampled (TS use
four for some reason), which leaves three to use for extra meaning.
http://www.embeddedarm.com/about/resource.php?item=303#adc
I want to put all the data I can into a single IO stream however things could
just get complicated and the userspace tool would be spending it's time
decoding the spiel rather than acting on it.
I'll look to Phil's MAX197 (and other peoples similar drivers) for
inspiration; my brain is telling me that timestamps at regular intervals,
prepended to *every* sample, and using the three bits of spare data to state
status like 'ring buffer x/4 full' (2 bits) and 'last sample' (1 bit) would
be the best approach.
> > * any failure conditions I cannot think of
> > * as I do not use this type of functionality I have no idea how
> people like
> > to use this type of thing
> > * should I be interweaving the /dev stream with timestamps when the
> samples
> > were taken?
>
> Depends....Is there any support for other sampling rates with this HW?
>
Well the TS-7800 is no HP 54xxx :) If you consider 'other' meaning 2000Hz/x
(where 'x' is between 1 and 6 depending on the number of inputs you want to
source) then yes.
Cheers
Alex
[1] http://lwn.net/Articles/223033/
--
________________________________________
/ All articles that coruscate with \
\ resplendence are not truly auriferous. /
----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|