Shop OBEX P1 Docs P2 Docs Learn Events
Dallas 1wire and BS2 — Parallax Forums

Dallas 1wire and BS2

ArchiverArchiver Posts: 46,084
edited 2001-02-05 23:39 in General Discussion
As usual, Jon is right. The chip will let a BS2SX, BS2, BS1 or any
serial capable device (PC, Mac, PDA...) talk with 1-wire devices.

The DS2401 doesn't know many tricks so many of the interface chip's
features won't get a chance to come out and play. If you've got a
single '2401 you're talking with, your BS2 program can be as simple
as:

'DS2401.BS2: read serial number

Baud CON 396 + 32768 ' 2400 baud, open mode, BS2
Ser_Pin CON 10

' 1-Wire interface chip command codes
reset CON 12
put CON 8
get CON 7

'ROM function commands
Read_ROM CON $33

' variables
in_byte VAR BYTE(8)

' initiate reset-presence sequence
SEROUT Ser_Pin,Baud,25,[noparse][[/noparse]reset]
' send Read ROM to bus
SEROUT Ser_Pin,Baud,25,[noparse][[/noparse]put,1,Read_ROM]
' solicit 8 bytes in response
SEROUT Ser_Pin,Baud,25,[noparse][[/noparse]get,8]
' accept 8 bytes from interface chip
SERIN Ser_Pin,Baud,[noparse][[/noparse]STR in_byte\8]

This program will read the serial ID of virtually any 1-Wire device
into the in_byte array.

There are lots of other functions available in the interface chip to
simplify common command sequences, conveniently handle multiple
devices on the 1-Wire bus, etc.


Regards,

Steve

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-02-05 22:25
    [font=arial,helvetica]Hey there, anyone have an idea of which components to use to interface 1-wire
    to BS2? In particular, I am using a DS2401 1wire device.
    Thanks in advance
    Lou
    lusabi1@aol.com (lusabi is italian for wasabi.)[/font]
  • ArchiverArchiver Posts: 46,084
    edited 2001-02-05 23:00
    [font=arial,helvetica]In a message dated 2/5/01 4:48:40 PM Central Standard Time, Lusabi1@aol.com
    writes:


    Hey there, anyone have an idea of which components to use to interface
    1-wire
    to BS2? In particular, I am using a DS2401 1wire device.



    The BS2p, about ready to roll out the door from Parallax, has native 1-Wire
    and I2C support. ·Documentation is available in the new manual which you can
    download from Parallax (www.parallaxinc.com).

    -- Jon Williams
    -- Dallas, TX
    [/font]
  • ArchiverArchiver Posts: 46,084
    edited 2001-02-05 23:07
    [font=arial,helvetica]Im aware of the BS2p, but I have a BS2 currently, and am interested in using
    it for the purpose of a 1-wire master. Although I most likely will buy one,
    it wont be for awhile yet (bills :-) so I must utilize what I have .
    Thank you though Jon, appreciate the response. Any more info on this topic
    will be appreciated. (before I pull what little hair I have left out of my
    throbbing head!!!!!)
    Lou[/font]
  • ArchiverArchiver Posts: 46,084
    edited 2001-02-05 23:33
    [font=arial,helvetica]In a message dated 2/5/01 5:09:01 PM Central Standard Time, Lusabi1@aol.com
    writes:


    Im aware of the BS2p, but I have a BS2 currently, and am interested in using
    it for the purpose of a 1-wire master. Although I most likely will buy one,
    it wont be for awhile yet (bills :-) so I must utilize what I have .
    Thank you though Jon, appreciate the response. Any more info on this topic
    will be appreciated. (before I pull what little hair I have left out of my
    throbbing head!!!!!)



    Steve Parkiss has an SX coprocessor designed to allow Ann non-BS2p to talk
    with 1-Wire devices. ·Take a look at: http://home.earthlink.net/~parkiss/

    -- Jon Williams
    -- Dallas, TX
    [/font]
  • ArchiverArchiver Posts: 46,084
    edited 2001-02-05 23:39
    [font=arial,helvetica]Thank You. :-)

    L[/font]
Sign In or Register to comment.