BS2 1-wire help
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?
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
(Timing can be a real *****)
Instead, just add a DS2480b chip and use standard 9600bps serial communications.
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]
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.
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 Williams
Applications Engineer, Parallax
Dallas Office
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...
They didn't have any used ones...
(I'm heading for Amazon instead)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office