Dallas 1-wire
Archiver
Posts: 46,084
Has anyone successfully gotten a BS2 to work with Dallas semi's 1-wire
network?
-
Ian Bobbitt
When an error occures:
A novice user blames himself,
a normal user blames the computer,
a power user sighs and gets another cup of coffee.
KB9VEX
ICQ: 14106680
It said requires windows 95 or better, so I installed Linux.
network?
-
Ian Bobbitt
When an error occures:
A novice user blames himself,
a normal user blames the computer,
a power user sighs and gets another cup of coffee.
KB9VEX
ICQ: 14106680
It said requires windows 95 or better, so I installed Linux.
Comments
bobbitti@b... writes:
> Has anyone successfully gotten a BS2 to work with Dallas semi's 1-wire
> network?
The BS2p (coming mid January, 2001) has native 1-wire support (both bit and
byte mode). The commands work just like SERIN and SEROUT -- except that
they're called OWIN and OWOUT. The commands are very easy to use and don't
require any hardware outside the Stamp except a 4.7K pullup and your 1-wire
devices.
issues are the problem--the interpreter can't string together several
discrete statements fast enough to meet the 1-wire time criteria.
The BS2+ solves this problem by doing the 1-wire grunt work for you
via a single command rather than as a series of commands. Also saves
you an awful lot of code and code space in the process.
The BS2+ with its 1-wire capability opens up a whole new array of
nifty gadgets for your Stamp at minimal I/O pin cost. They're worth
a look at http://www.dalsemi.com/products/autoinfo/1wire.html and
http://www.dalsemi.com/products/autoinfo/touch.html. One of my
favorites is the DS1921, a horse-pill sized gadget that I hauled down
to the bottom of the Grand Canyon (and, fortunately, back up again)
several weeks ago, then recovered temperature data stored therein
covering several days upon my return.
For those who may want to add a 1-wire capability to their existing
Stamp (I've tested BS1 through BS2SX), I have developed and am using
in my own gadgets an interface chip allowing communication with
1-wire devices via SEROUT and SERIN statements. It makes using up
to 10 1-wire devices at once very convenient for your Stamp and
takes care of many of the unique 1-wire functions (such as SEARCH
ROM, device selection, strong pullup control, alarm detection, etc.)
for you. Let me know if interested.
Steve
On 14 Dec 00 at 19:55, givner@s... wrote:
> I'm trying to get my Basic Stamp 2 to work with Dallas
> Semiconductor's 1820 1-wire bus chip. I found a post in one of your
> e-mail groups about this same problem. Someone responded to this
> e-mail by saying that the BS2p has native 1-wire support. Does this
> mean that the Basic Stamp 2 that I have does not have the
> capabilitiy to interface with the DS 1820's 1-wire bus?...
1820 1-wire bus chip. I found a post in one of your e-mail groups
about
this same problem. Someone responded to this e-mail by saying that
the
BS2p has native 1-wire support. Does this mean that the Basic Stamp 2
that I have does not have the capabilitiy to interface with the DS
1820's 1-wire bus? If it does have the capability then I need help in
designing a code to read the 64-bit ROM id of the DS1820. The code I
have listed below prints the first 30 bits of the id in the debug
window. The problem is that the bits all come out as zeroes which is
wrong according to the people at Dallas Semiconductor. Please help me
because I am presently at my wits end!
WB con 4
LCD con 9
hold var byte 'work space for 1820 command.
n var word 'variable timing word for DS1820
write_1:
PULSOUT WB,2 'the length of this and
other
pulses in the code
INPUT WB 'are based on the
DS1820
data sheet info.
PULSOUT LCD,20 'this command serves as a
time
holder.
OUTPUT WB
HIGH WB
return
write_0:
PULSOUT WB,45
PULSOUT LCD,13
INPUT WB
PULSOUT LCD,1
OUTPUT WB
HIGH WB
return
id:
debug cls
debug " please wait"
pause 500
debug cls
OUTPUT WB 'send reset and presence pulses.
HIGH WB
PULSOUT WB,470
INPUT WB
pause 1 'wait for presence state to
end.
OUTPUT WB 'start sending a command.
HIGH WB
gosub write_1
gosub write_1
gosub write_0
gosub write_0
gosub write_1
gosub write_1
gosub write_0
gosub write_0
n = 0
goto id_test1
read_0:
debug "0"
OUTPUT WB
HIGH WB
n = n + 1
goto id_test1
read_1:
debug "1"
OUTPUT WB
HIGH WB
n = n + 1
goto id_test1
id_test1:
pulsout WB,1
INPUT WB
IF n = 30 THEN yo
IF WB = 1 THEN read_1
goto read_0
yo:
OUTPUT WB 'send reset and presence
pulses.
HIGH WB
PULSOUT WB,470
INPUT WB
PAUSE 1 'wait for presence
state
to end.
OUTPUT WB 'end sending and receiving
command process.
HIGH WB
pause 1000
debug CLS
debug "id confirmed"
pause 1000
If you have any questions about the code or can help me in any way,
please e-mail me back at givner@s...
January which has native 1Wire support.
It's going to save you a lot of time
and code space!
The Dec issue of Nuts and Volts has an
article by Jon which gives some examples
of using 1Wire with the BS2P, including
a program that reads the DS1810 thermometer.
It seems that some of the listings from
this article are missing though - there
is reference to a listing 2 which isn't
in the magazine or on nutsvolts.com from
what I can see.
T
analog8@home.com writes:
January which has native 1Wire support.
It's going to save you a lot of time
and code space!
And the BS2p is a joy to work with. ·It's really a great new Stamp.
article by Jon which gives some examples
of using 1Wire with the BS2P, including
a program that reads the DS1810 thermometer.
It seems that some of the listings from
this article are missing though - there
is reference to a listing 2 which isn't
in the magazine or on nutsvolts.com from
what I can see.
I noticed the missing listings too. ·Don't worry though, they will get posted
at www.nutsvolts.com and also at www.parallaxinc.com in the very near future.
-- Jon Williams
-- Dallas, TX[/font]