Owout & owin
Archiver
Posts: 46,084
I've been experimenting with OWOUT and OWIN.
Does anyone know the basic structure of OWOUT and OWIN statements?
I'm interested in the [noparse][[/noparse]Output Data] and [noparse][[/noparse]Input data] structure.
I've seen both OWOUT pin, 1, [noparse][[/noparse]skiprom, converttemp] and
OWOUT pin, 1, [noparse][[/noparse]matchrom, str romdata\8, converttemp].
Why are there 2 items in first OWOUT and more items in 2nd OWOUT
statement?
I've read the Dallas spec. sheet on DS18S20, but it doesn't give
info. about data structure either.
Is there some good (& short if possible) info. available?
Secondly, is it possible to do 1 wire interfacing with BS2?
Much thanks in advance.
Does anyone know the basic structure of OWOUT and OWIN statements?
I'm interested in the [noparse][[/noparse]Output Data] and [noparse][[/noparse]Input data] structure.
I've seen both OWOUT pin, 1, [noparse][[/noparse]skiprom, converttemp] and
OWOUT pin, 1, [noparse][[/noparse]matchrom, str romdata\8, converttemp].
Why are there 2 items in first OWOUT and more items in 2nd OWOUT
statement?
I've read the Dallas spec. sheet on DS18S20, but it doesn't give
info. about data structure either.
Is there some good (& short if possible) info. available?
Secondly, is it possible to do 1 wire interfacing with BS2?
Much thanks in advance.
Comments
designed for, the constants (i.e., SkipROM and ConvertTemp) will make sense.
Each device has its own interface requirements for commands. This is not
something that we defined, the code you list below is simply a PBASIC
implementation
of the Dallas specification for that particular device.
-- Jon Williams
-- Parallax
In a message dated 6/12/2003 12:25:46 PM Central Standard Time,
basicstampede@y... writes:
> I've been experimenting with OWOUT and OWIN.
> Does anyone know the basic structure of OWOUT and OWIN statements?
> I'm interested in the [noparse][[/noparse]Output Data] and [noparse][[/noparse]Input data] structure.
>
> I've seen both OWOUT pin, 1, [noparse][[/noparse]skiprom, converttemp] and
> OWOUT pin, 1, [noparse][[/noparse]matchrom, str romdata\8, converttemp].
> Why are there 2 items in first OWOUT and more items in 2nd OWOUT
> statement?
>
> I've read the Dallas spec. sheet on DS18S20, but it doesn't give
> info. about data structure either.
>
> Is there some good (& short if possible) info. available?
>
> Secondly, is it possible to do 1 wire interfacing with BS2?
>
> Much thanks in advance.
>
[noparse][[/noparse]Non-text portions of this message have been removed]
I saw in an article following codes:
WaitForConversion:
Pause 25
OWIN DS1820pin, OW_BitMode, [noparse][[/noparse]tempIn]
IF tempIn = 0 THEN WaitForConversion
First the IF statement is encountered, tempIn will be zero until
tempIn has been read. But in subsequent times, tempIn will not be
0. So how does this statement work?
Much thanks in advance.
--- In basicstamps@yahoogroups.com, jonwms@a... wrote:
> If you consult the documentation for the 1-Wire device that the
program is
> designed for, the constants (i.e., SkipROM and ConvertTemp) will
make sense.
> Each device has its own interface requirements for commands. This
is not
> something that we defined, the code you list below is simply a
PBASIC implementation
> of the Dallas specification for that particular device.
>
> -- Jon Williams
> -- Parallax
>
> In a message dated 6/12/2003 12:25:46 PM Central Standard Time,
> basicstampede@y... writes:
>
> > I've been experimenting with OWOUT and OWIN.
> > Does anyone know the basic structure of OWOUT and OWIN statements?
> > I'm interested in the [noparse][[/noparse]Output Data] and [noparse][[/noparse]Input data] structure.
> >
> > I've seen both OWOUT pin, 1, [noparse][[/noparse]skiprom, converttemp] and
> > OWOUT pin, 1, [noparse][[/noparse]matchrom, str romdata\8, converttemp].
> > Why are there 2 items in first OWOUT and more items in 2nd OWOUT
> > statement?
> >
> > I've read the Dallas spec. sheet on DS18S20, but it doesn't give
> > info. about data structure either.
> >
> > Is there some good (& short if possible) info. available?
> >
> > Secondly, is it possible to do 1 wire interfacing with BS2?
> >
> > Much thanks in advance.
> >
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
continue to suggest that you always download and read the docs for a given part
-- even if we supply code for it. We don't write code for a device without
consulting the docs. How could we? Okay, enough on reading specs.
The DS1820 will return a bit 0 when it is in the middle of the conversion
process. The loop below checks the DS1820 every 25 milliseconds to see if it's
done with the current conversion. Notice the constant OW_BitMode. This bit of
code is NOT reading the temperature, it is reading the state of the
conversion process. When done, the code can move on to retrieving the current
temperature (not shown below). The purpose of this code is to conserve program
time.
The spec says the typical conversion time is about 200 milliseconds. We use
this loop instead of PAUSE 200 because we've found that the actual temperature
conversion is shorter.
-- Jon Williams
-- Parallax
In a message dated 6/12/2003 12:51:52 PM Central Standard Time,
basicstampede@y... writes:
> Thank you for the reply.
>
> I saw in an article following codes:
>
> WaitForConversion:
> Pause 25
> OWIN DS1820pin, OW_BitMode, [noparse][[/noparse]tempIn]
> IF tempIn = 0 THEN WaitForConversion
>
> First the IF statement is encountered, tempIn will be zero until
> tempIn has been read. But in subsequent times, tempIn will not be
> 0. So how does this statement work?
>
> Much thanks in advance.
[noparse][[/noparse]Non-text portions of this message have been removed]
Since OWIN pin, OW_bitmode, [noparse][[/noparse]tempIn] is in bit mode, then even after
conversion, tempIn.bit0 may still be zero (50% chance).
So if you say IF tempIn = 0 THEN WaitForConversion, do you not risk
that you will be in an endless loop?
Much thanks in advance.
--- In basicstamps@yahoogroups.com, jonwms@a... wrote:
> I know I must sound cranky, but honestly, I'm not. That said, I
will still
> continue to suggest that you always download and read the docs for
a given part
> -- even if we supply code for it. We don't write code for a device
without
> consulting the docs. How could we? Okay, enough on reading specs.
>
> The DS1820 will return a bit 0 when it is in the middle of the
conversion
> process. The loop below checks the DS1820 every 25 milliseconds to
see if it's
> done with the current conversion. Notice the constant OW_BitMode.
This bit of
> code is NOT reading the temperature, it is reading the state of the
> conversion process. When done, the code can move on to retrieving
the current
> temperature (not shown below). The purpose of this code is to
conserve program time.
> The spec says the typical conversion time is about 200
milliseconds. We use
> this loop instead of PAUSE 200 because we've found that the actual
temperature
> conversion is shorter.
>
> -- Jon Williams
> -- Parallax
>
> In a message dated 6/12/2003 12:51:52 PM Central Standard Time,
> basicstampede@y... writes:
>
> > Thank you for the reply.
> >
> > I saw in an article following codes:
> >
> > WaitForConversion:
> > Pause 25
> > OWIN DS1820pin, OW_BitMode, [noparse][[/noparse]tempIn]
> > IF tempIn = 0 THEN WaitForConversion
> >
> > First the IF statement is encountered, tempIn will be zero until
> > tempIn has been read. But in subsequent times, tempIn will not
be
> > 0. So how does this statement work?
> >
> > Much thanks in advance.
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
this point, we're looking for the end-of-conversion signal [noparse][[/noparse]then we go get the
temperature], and 2) the IF-THEN construct uses the entire variable tempIn, not
just Bit0. If any of the other bits are set, then it will move forward.
-- Jon
In a message dated 6/12/2003 1:28:29 PM Central Standard Time,
basicstampede@y... writes:
> Thanks for the reply. No, you don't sound cranky to me.
>
> Since OWIN pin, OW_bitmode, [noparse][[/noparse]tempIn] is in bit mode, then even after
> conversion, tempIn.bit0 may still be zero (50% chance).
> So if you say IF tempIn = 0 THEN WaitForConversion, do you not risk
> that you will be in an endless loop?
>
> Much thanks in advance.
[noparse][[/noparse]Non-text portions of this message have been removed]
Why is Mode 2 used in OWIN?
e.g. OWIN pin, 2, [noparse][[/noparse]tInLow, tInHi]?
Mode 2 is reset after data, byte mode.
Is it necessary to reset after data (as opposed to before)?
Is byte mode necessary (vs. bit mode)?
Much thanks in advance.
--- In basicstamps@yahoogroups.com, jonwms@a... wrote:
> No, for two reasons. 1) We're actually not looking for the
temperature at
> this point, we're looking for the end-of-conversion signal [noparse][[/noparse]then we
go get the
> temperature], and 2) the IF-THEN construct uses the entire variable
tempIn, not
> just Bit0. If any of the other bits are set, then it will move
forward.
>
> -- Jon
>
> In a message dated 6/12/2003 1:28:29 PM Central Standard Time,
> basicstampede@y... writes:
>
> > Thanks for the reply. No, you don't sound cranky to me.
> >
> > Since OWIN pin, OW_bitmode, [noparse][[/noparse]tempIn] is in bit mode, then even
after
> > conversion, tempIn.bit0 may still be zero (50% chance).
> > So if you say IF tempIn = 0 THEN WaitForConversion, do you not
risk
> > that you will be in an endless loop?
> >
> > Much thanks in advance.
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]