Shop OBEX P1 Docs P2 Docs Learn Events
BS2 1-wire help — Parallax Forums

BS2 1-wire help

MagicRuBMagicRuB Posts: 12
edited 2004-11-30 16:46 in BASIC Stamp
Greetings!

I am familiar with the 1-wire commands (OWIN/OWOUT) for my BS2p but I am trying to communicate with·a standard BS2 which does not offer this protocol. I am seeking code examples for the BS2 to·enable it·1-wire capabilities.

For example, google found me this·code-workaround link that offers·I2C protocol sub-routines.
·· http://www.robot-electronics.co.uk/htm/srf08stamp.shtml

I'm looking for something similar, but for 1-wire.
Can anyone help?

Comments

  • GadgetmanGadgetman Posts: 2,436
    edited 2015-07-01 22:39
    Don't bother trying to emulate the workings of the OWIN/OWOUT commands.
    (Timing can be a real *****)

    Instead, just add a DS2480b chip and use standard 9600bps serial communications.
  • MagicRuBMagicRuB Posts: 12
    edited 2004-11-29 15:25
    This looks promising. I like it.

    After looking at its datasheet, I found a small detail which might be a show stopper for what I'm trying to use 1-wire for. I was originally planning on making a small LAN of about 5 cpu's with I2C but found that the BS chips can only act as a master. I then set my sights on 1-wire but the datasheet for the chip you mentioned says "<The DS2480b> works with any MicroLAN-Compatable 1-wire slave devices."

    At the same time is says "Universal, Common-Ground serial Port for MicroLAN Applications".

    I think I'm confused. This is the first I've seen about master/slave in the 1-wire system. Has anyone had any trouble using multiple CPU's talk through 1-wire? Should I not worry about it?

    Part of the reason I wanted the code spelled out in PBASIC (like that I2C code I mentioned above) is because one of the CPU's I'm using is a vintage 8086 that I'm putting togetehr from scratch (Don't ask why, I'm just try'n to kill myself with this project.. for fun). It's easy to convert the PBASIC into assembly. Using this chip would save a huge headache with the assembly for the 1-wire though. Thank you [noparse]:)[/noparse]
  • GadgetmanGadgetman Posts: 2,436
    edited 2004-11-30 10:41
    The DS2480(b) is a chip that converts from RS232 to 1-Wire, and can only be used as a master.(It does in hardware what the BS2p's OWIN/OWOUT instructions does in software)

    Unfortunately, the 1-wire net isn't designed for more than one master. (It would have added way more complexity)

    It is possible to connect more than one master, but it requires a lot of fiddling with electronics to block the masters from transmitting all at once.

    If you really want to use 1-wire, and only one cpu needs to be master, you may want to look at some of the dual-port or IO chips in the series.(There's one with 8 IO pins, and I think at least one with both 1-wire and a 3pin serial)

    'Microlan' is just a fancy word they like to use when they've already used the word 1-wire in the sentence...

    I suggest you go to http://www.maxim-ic.com/an_prodline2.cfm/prodline/21 and read some of the Appnotes there.
    Particularly the 'Overview of 1-Wire Technology and its use' is a good read.
  • MagicRuBMagicRuB Posts: 12
    edited 2004-11-30 10:49
    Thanks for the link. I'll check it out.

    Would 1-wire be a bad choice for what I'm trying to do? I am planning on having a quasi master.. the AI cpu of the bot would be gathering data from other cpus and then telling other cpu's to other stuff..

    Could I use the AI cpu (a BS2p) as a 'master' and control other 'slave' BS2p's?

    I'll check into the multiport I/O system you mentioned.

    Is there a better way I could be doing this? I'm looking at having 5 or so cpu's talking to each other. I looked into CAN (Controller Area Network, common in car cpu networks) but it seemed expensive and a little too complicated for what I needed.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-30 11:51
    You might want to check out Jan Axelson's book: Serial Port Complete. I think you'll find lots of useful information in it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • GadgetmanGadgetman Posts: 2,436
    edited 2004-11-30 13:45
    That's an expensive book....

    Try this to get a used copy:
    http://dogbert.abebooks.com/servlet/SearchResults?imagefield.x=20&cm_re=A*Search+Box*Form&tn=Serial+Port+Complete&imagefield.y=10

    But wait a few minutes until I've ordered the cheapest one myself...

    smile.gif
  • GadgetmanGadgetman Posts: 2,436
    edited 2004-11-30 13:58
    Forget it...

    They didn't have any used ones...
    (I'm heading for Amazon instead)
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-30 16:46
    Good technical books are never cheap ... but then, neither is wasted time.... I saw that Amazon has Jan's book for about $27 bucks -- a good deal, I think.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
Sign In or Register to comment.