USB Design Idea & Thoughts

Mar 18, 2005 15 Replies

Hi All - would appreciate any thought or pointers on the following.



As a part of a project I am thinking to use a number of USB WLAN adapters, these would not be used as normal, instead they would plug in to my own little PIC processor board. the idea is a little PIC chip would communicate with the USB WLAN device, set its parameters and enable it to go on air - now these devices would all be visible on a main PC with a WLAN card. the devices would be used for example with a little temperature sensor and would send back the data to the PC or in some cases with different devices have a two way communication.



Now I have heard and read some about the Host Controller for the USB however, I don't see why my little USB and WAN and PIC device needs a Host Controller as long as the PIC sets up the registers in the USB device and initialize it to send and receive the data.



If I am on the wrong track, would appreciate some thoughts and feedback on this.



Thanks very much. Sean


On Thu, 17 Mar 2005 16:03:04 -0000, "NDO News" wroth:

Start simply. Getting a PIC to recognize, much less talk to, a USB device of any sort is a first step in the right direction but one that will probably take you a year or two to get working.

A PIC to PCMCIA card interface might be an easier project. You can get PCMCIA WAN cards that work the same way a USB WAN device does.

Jim

But *how* would your PIC do that? The only interface you have is the USB interface, and to use that you must act as an USB host.

Wouter van Ooijen

-- ------------------------------------

formatting link
Webshop for PICs and other electronics
formatting link
Teacher electronics and informatics

I appreciate that, but why would it be so difficult to do this? excuse my ignorance, but USB uses a protocol, a hand shake can that not be done by a processor - handshake, initialize the IP, SSID etc and read/write data?

The processor just have to do that, then receive data and send data to a PC via the WLAN.

The choice will have to be USB only, can not use other interfaces.can some one break down the USB Host Controllers function briefly please?

Thanks Sean

On Fri, 18 Mar 2005 23:10:15 GMT, "Blue News" wroth:

Take a look at

formatting link
to see what you must build and put between your PIC and any USB device that you want to use.

You cannot simply connect a USB device directly to some of the PICs pins and expect anything good to happen.

If you MUST have a USB interface then you MUST use at least all the hardware that is shown in that user's manual.

You should go ahead and buy something like that module rather than trying to build your own.

Jim

Thanks Jim,

I wasn't planning to connect USB pins directly to a PIC, I was thinking more in the lines of one of the FTDI's USB UART devices, these would take USB and output the data in serial and I am sure have seen a circuit using this chip outputting in parallel format see link

formatting link

Now if I can read/write data from/to the USB WLAN module then I should be able to initialize etc don't you think?

I don't know of anything (WLAN module) available out there that I can buy to for example connect a temperature sensor to it and read it on a wireless laptop... Have a look at the nasty ASCII block below. This is a design idea I am thinking about and the criteria is: must use USB due availability of cheap modules out there - must use existing WLAN as half of the job is done and for its purpose it needs to use it. these two can not be changed - impossible?

ANT USB WLAN PIC/FTDI Sensor Wireless Laptop |______-----------_____------------____S ----------- ------------ Sean

On Sat, 19 Mar 2005 10:41:53 -0000, "NDO News" wroth:

OK, now I think I get a bit better idea of what you want to do.

If you had two wireless laptops, you could connect a temperature sensor to one of them and read the temperature on the other one. What you want to do is to replace the laptop, the one with the temperature sensor, with a USB WLAN device connected to something that can perform the same function as a laptop but is less expensive.

That "something" might be a PIC but it's my guess that the software and extra hardware necessary to do the job with a PIC would make it a formidable project.

A Rabbit microprocessor single-board computer with a built-in USB port and software support for networking applications would be a much more managable platform.

Check out

formatting link
and AN-405 at that site.

Jim

If you are ignorant (your word) why do you assume it will be simple while people who claim to be less ignorant say it's not?

If you want to find out for yourself: start reading the USB specification.

Wouter van Ooijen

-- ------------------------------------

formatting link
Webshop for PICs and other electronics
formatting link
Teacher electronics and informatics

These are USB *slave* chips, you can't connect two slaves and expect something usefull to happen.

Wouter van Ooijen

-- ------------------------------------

formatting link
Webshop for PICs and other electronics
formatting link
Teacher electronics and informatics

Slaves are obliged to do exactly what their masters tell them to do.

That is the Law.

Key thing to understand, is that USB was designed for the _slave_ to be pretty easy to do. Unfortunately, one of the costs of this, is that the master has to do all the work. A master unit, potentially must support two data rates, it has to support polling the devices at defined intervals, and responding if they require service. It also is required to support

64bytes of hardware buffer. At the very simplest level, what you want, _could_ be done by a PIC, linked to a FPGA, to handle the interface, with an implementation of a simplified USB stack, and a single handler coded for the one target device. I'd be talking in terms of perhaps a couple of thousand dollars to develop the hardware, and perhaps four times this for the code, _provided_ the manufacturers of the WLAN module are prepared to give you full details of how to program the unit. Without this, the costs escalate. Conversely, you could attach a 8019 Ethernet controller to a PIC, and talk to this, with your own RS485 interface, using largely off the shelf code (there are TCP/IP implementations for the PIC and this chip), and a prototype, would only involve a very few hundred dollars of work. The cheapest solution to do what you describe, assuming the device you want to talk to is supported in Linux, is one of the single board PC's, with a complete embedded Linux. As for a Wlan module, there are complete solutions designed to interface to instruments on the market, that will connect directly to a processor. Have a look at the Lantronix site, and their WiPort device, or the Digi-Connect 'Wi-Me'. What you describe, really is a hard solution.

Best Wishes

Actually, rather than go through all the USB interfacing to get to the WLAN, you could use and Airborne from DPAC and just use a serial port. to interface your sensor system. Biggest problem is the cost of the development kit.

Charlie -- Edmondson Engineering Unique Solutions to Unusual Problems

James,

I have a few of these modules and the idea was to use these for my prototypes, i.e. PIC talks to one of these modules and the module talks to the WLAN (USB) - that was the idea, but now I am confused - from the trail of these posts I thought it can not be done without a USB controller on my design.

Sean

Thank you for taking the time and your positive inputs. I will be looking at some of the suggestions you have been making.

Sean

This is a newsgroup where people exchange and bounce ideas in a positive way. I know it is a difficult project maybe impossible, but if every one took the same negative attitude as I see in your posts then we wouldn't be where we are with technology today. There are always ways, work around and new ideas, look at the few who have bothered to reply to my post in a informative and positive manner - take Roger or James' post - its not a negative two liner like "But *how* would your PIC do that?" (your own words) I wasn't looking for the newsgroup police Wouter. The moral of the story is if you cant do something positive, don't bother doing it at all.

Sean

Lets look at this from another angle - the reason it needs to be USB is because WLAN USB are many and cheap. In my project I need to setup many of these monitoring different things both analogue and digital. I opened on of these USB WLANs and inside there are Zydas chipsets, are there any way to bypass the USB section of these little units and tap directly (again broadly spoken via PIC etc) to the chipset...? Just a though.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required