BS2 and USB... Who is the master?
Kaos Kidd
Posts: 614
··There are some really nifty USB items out there, of quality and not expensive, called Phidgets.· They all use a USB interface.· I called to ask about the device to device protocall, citing I wanted to use a BS2 to be the host.· Well, they avoided the whole issue about the device to device protocall by saying "The basic stamp is a slave, as well as all the Phidgets.· Therefore you can't connect the two."
· I have a problem believing this, because we (stamp users) have direct access to the USB chip, therefore the ability to create a "Host".· Next, it's hard to believe this, but it's the first time I ever heard the issue of "master/slave" in the USB connection / Communication layout.
· How much truth is there to this, the Master / Slave issue metioned?·
· If this is the truth, can in fact the BS be made a "Master" or "Host"
· I precieve the USB to be nothing more then a serial communication with a common protocall.· This being the case, then the USB devices mearly "listen" on the bus for their identifer and respond.· USB is a method of inter-device communications, a protocall, not the method of software to software (host to device) communications.· To Clairfy my example:· If UDP is the language used to communicate the conversation, and the datagram is the conversation then:· USB is the language, and the conversation is the data.· Is this right?
· At this point, I am seriously considering getting one of the Phidgets and trying to "hack" out the communications just to prove the issue.· At the expense of some $40.00 USD.
Searching for the truth...Answers anyone?
Thanks !
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
·
· I have a problem believing this, because we (stamp users) have direct access to the USB chip, therefore the ability to create a "Host".· Next, it's hard to believe this, but it's the first time I ever heard the issue of "master/slave" in the USB connection / Communication layout.
· How much truth is there to this, the Master / Slave issue metioned?·
· If this is the truth, can in fact the BS be made a "Master" or "Host"
· I precieve the USB to be nothing more then a serial communication with a common protocall.· This being the case, then the USB devices mearly "listen" on the bus for their identifer and respond.· USB is a method of inter-device communications, a protocall, not the method of software to software (host to device) communications.· To Clairfy my example:· If UDP is the language used to communicate the conversation, and the datagram is the conversation then:· USB is the language, and the conversation is the data.· Is this right?
· At this point, I am seriously considering getting one of the Phidgets and trying to "hack" out the communications just to prove the issue.· At the expense of some $40.00 USD.
Searching for the truth...Answers anyone?
Thanks !
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
·
Comments
If you don't believe me, check out the USB spec or spend your Phidget money on Jan Axelson's book "USB complete".
For what it's worth, no Stamp "speaks USB".· They only speak serial to a USB chip which handles all of the low-level stuff.
HTH
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Im probably going to take Tom's advice myself and get the USB complete book. I would like to understand USB more fully as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 2/10/2006 2:41:03 PM GMT
This is triggered by your statement "I precieve the USB to be nothing more then a serial communication with a common protocall" -- because your perception is dramatically WRONG in this case.
RS-232 serial-based communications do not necessarily have a "master-slave" relationship. If one device is 'listening' when the other device 'sends', communication can occur.
USB-based device DO have a 'master-slave' relationship. The 'master' queries the bus, the 'slave' responds with it's device code. The 'master' then goes into a large registry of its known USB devices, to find the driver for this particular 'slave'. It then loads that driver, and then uses that driver to communicate with the 'slave'.
It takes a reasonable amount of hard-disk space to store that registry, and the drivers. This is what some programmers call "non-trivial". It is really, honest-to-God, beyond the capabilities of a device with 2000 bytes of program storage space, and 32 bytes of ram to be a USB master. It just is.
Now, being a USB 'slave' device is relatively simple -- the FTDI company has created an affordable chip to implement that side, along with the appropriate drivers for the PC side. But that device STILL will not allow you to connect two USB slave devices together so they can communicate with each other -- unless you have a USB 'master' device relaying the data.
Now, I expect you're going to do whatever you want, anyway, so let me just summarize:
1. At the present time, there is no interface chip (that I know about, anyway) that would let a BS2 be a USB 'master'.
2. A BS2 by itself cannot be a USB master.
3. It sounds like an interesting project to hack a "phidget"
4. Two USB 'slaves' CANNOT talk to each other without a 'master' in the middle.
Believe every bit of what you were told. If you have any doubts at all, I suggest you read the entire USB specifications from cover to cover, which is the best way to learn about it. Second to that, or along with it, would be Jan Axlerod's book "USB Complete", now in its Third Edition. The entire USB 2.0 Specifications can be downloaded from the link below, for free, but make sure you bring lunch! :
http://www.usb.org/developers/docs/
The single biggest problem with using any device as a USB HOST, is that the HOST must be able to load and execute the appropriate device drivers on-the-fly. Unlike other serial protocals, there is NO device independence WITHOUT these device drivers, therein the problem.
Save your $40.00 on the "Phigets", and use it as a down payment on Jan's excellent USB book. Like air brakes on a jackass, trying to use any Stamp as a USB HOST is just not going to happen in this lifetime. Sorry!
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
http://www.beyondlogic.org/usbnutshell/usb1.htm
Thanks every one on the ‘warnings’ and information, it’s all taken to heart.· After I posted the question, I did read parts of the USB 2.0 spec.· I also did other research on the matters.· My current “Perception”: There are far better then I whom can make since of it all.· However, I am going to order the USBWiz, and continue to move forward.· I’m not looking to create what a PC host can do, only communicate to a single family of devices.· I do believe it’s a complicated subject, but, if you look at what you’re trying to do, remove things you don’t need, it does get somewhat simpler.· For example, I won’t have to load drivers, or support hot swappable devices.· Only provide for data exchange with a limited family / class of products.· Thanks again everyone, for all the information.
allanlane5:·
· I find your reply irritating, and inflammatory, and now you (and sadly, everyone else) will get to read why:· I explained, very clearly what it was I was trying to do.· I further explained how I thought things worked.· Finally I ask the question, “Is this right?”· I was very clear and concise in the wording I used, “I perceive”; it was designed to let the reader know it’s how I thought things were, not a statement of fact, as you yourself pointed out.· The tone of the first two paragraphs of your reply is counterproductive to the meaning and usage of the forums.· Yes, I may have been wrong, but I posted a question to better educate myself in the matter at hand.· Please demonstrate some compassion when dealing with those who know less then you.· I will·say this to you because I did single you out in this reply:· Thank you for the time it took you to write your reply.· There was some good information, although repeated in other posts, contained within it.· I have entertained the idea of hacking several of their devices.· I am in communications with their director of research and development, and we are going to see if I can get the actual command format needed to talk to some of their devices.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
·
I sincerely apologize for 'going off' that way. I am very happy that you do seem to be following a responsible path, and I do wish you luck with it.
I apologize if I wasn't clear enough in my request. This too shall improve.
I am looking, always looking for feedback... good or bad...
KK
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket
KK
·
kelvin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10