I think I need to do this (push the CSB-line of the probe to 0)
manually during the whole communication frame, that is, during the
whole 2-3 byte sending / reading.
So, I leave IOlineE undefined, and use just another oDIO1 to imitate
that signal.
The sensor wants 8bit-chunks as r/w commands despite it has 16-bit
registers to r/w.
This (sensor architecture) leads to another problem:
Because the data is split into 3 different locations in the sensor, I
need to do some nasty bit-operations (besides time-consuming multiple
accesses and register-swaps):
1) I have one 16-bit word where all the stuff will be copied to.
2) the MSB (3 bits) of the reading is in one register. Don't ask
why... Those have to be copied / moved to the 3 MSB of that word
3) The subsequent bits / bytes reside in a 16-bit register. From
there i need to copy the stuff in two 8-bit sequences starting from
bit 12 of the tgt-word, and continue 8 bits down to bit 5. The
remaining bits 4:0 are then filled with the 5 MSBs of the last
register byte...So I loose 3 bits but who cares. As this is an
altimeter-application I'm anyway on meter-scale. The original
resolution is ~10 cm, which I don't need at all.
If you guys have good tips / tricks to do this (bit-operations)
without choking the stack or the CPU, please feel absolutely
free...Meanwhile i try to do this with (bitwise? Do those even work)
OR/AND/XOR sentences and invent some loops for it, but it apparently
is not easy.
Last words; if you provide the resolution with oMAth and other linked
objects, well...I'm quite tight already with the object memory, so
rather code-stack than o-memory...
BR /M
--- In oopic@yahoogroups.com, "rtstofer" <rstofer@...> wrote:
>
> --- In oopic@yahoogroups.com, "mtiusanen" <mtiusanen@> wrote:
> >
> > Hi,
> > has anybody used this object for SPI-data transfer?
> > Well, at least this Rate-property is a mystery. What (Baud?)
rates are
> > there behind the 8 options?
> > Analog to oSerialL- there are values 1-5 standing for 1200-9600
Bauds.
> > But, if taken from oSerialPort, there are rates from 1200 to
50KBauds.
> > If someone has got this object working, I would be happy to see
some
> > examples, like how to receive bata which is wider than 16 bits.
My
> > intent is to use it with a Vti's SCP1000-D01 Pressure sensor,
which has
> > SPI.
> >
> > http://www.vti.fi/en/products-solutions/products/pressure-
> > sensors/scp1000-pressure-sensor
> >
> > BR /Mika
> >
>
> There are a few things to consider when the object says it handles
SPI
> on any IOLine. Mostly, it indicates that it is bit-banged and
doesn't
> use the SPI hardware. So, pick the highest speed you can - it
> certainly won't exceed the capability of the sensor.
>
> The difference between an 8 bit transfer and a 16 bit transfer is
> PROBABLY how the object deals with IOLineE. The object wants to
> toggle the line between every byte. So, use a oDIO line to do the
> device enable by lowering the output in code and try transferring 2
> bytes before raising it in code. The OOPic PROBABLY won't know the
> difference and the sensor will just see a gap between the two bytes.
>
> Richard
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment