On 8/11/2011 15:01, ekgnkb3d wrote:
Hi all experts,
so I just made some tests on a ARM 400MHz with I2C hardware driver DS2482
getting temperature from a DS18B20.
For me it's a surprise:
I've written a small C-program using the owcapi (see attached .c and
Makefile) http://old.nabble.com/file/p32244690/testowfs.c testowfs.c
http://old.nabble.com/file/p32244690/Makefile Makefile
I started the owcapi program without any owserver to read the uncached temp
10-times:
time ./testowfs uncached/28.018ACE010000.D8/temperature9 10
and counted average 670ms per 9-bit measurement, so far away from the 93ms
the conversion in the device costs.
A 12-bit measurement took 1180ms in average, so not much slower.
Later I started owserver and an owshell program 10 times to read the
uncached temp:
time for i in {1..10}; do /opt/owfs/bin/owread
/uncached/28.018ACE010000.D8/temperature9; done
and counted 1070ms per measurement, so you are right, this is a little bit
slower
An owfs call I can't measure at the moment, due to problems with the fuse
(other thread)
Achim
Your code looks fine, although you might note that printf() slows things
down. But only microscopically, compared to your desired results.
My guess, and I have not done a code read, is that each reqest to
uncached/ for ANY of the temperature registers triggers a full
conversion, and this takes time.
I do not see a way to control this, but maybe others can tell us.
One other thought:
Note that owfs will, regardless your accessing uncached/ periodically
trigger a conversion according to the timeout you have established (I
think the internal default is 1 second). When the conversion is
underway the 1-wire bus essentially locks, and releases when the
conversion is done. So I suggest you try increasing the update timeout
to some very large value and see if this is what's slowing things down
(presuming a read of uncached/.../temperature9/ will actually trigger a
9 bit conversion.
/m
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it.
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers