Have any made a USB host to client using a single PIC?

Stuck with a problem in your code? Seek help here.

Have any made a USB host to client using a single PIC?

Postby st2000 » February 12th, 2013, 5:15 pm

Hi,

I had an idea where a dongle would be placed in line with a keyboard. The dongle would have to be both a USB HID Keyboard host and a USB HID Keyboard client (aka peripheral). This should be easy to do using two PICs. But I was thinking of only using a 24F class of PIC. I was thinking of using the 24F's USB port as the Host. Host being more complex and (maybe) needing some of the HW support offered up by the 24F. But I was thinking the USB client / peripheral HID Keyboard side could be fashioned out of one of the other 24F's serial ports and some software / firmware.

So, really, the question boils down to if there are existing PIC USB client / peripheral HID Keyboard examples out there that do not need the PIC's USB port.

-thanks
st2000
 
Posts: 1317
Joined: February 3rd, 2011, 6:10 pm

Re: Have any made a USB host to client using a single PIC?

Postby k-ww » February 12th, 2013, 6:07 pm

Dosn't microchip have a chip you can use as a USB client [serial port]? MCP2200 / MCP2110

Not a one chip solution, but ....

Otherwise, what about using a PS/2 type keyboard instead of a USB one?

You could hide the electronics in the PS/2 Keyboard, and have it come out with a USB cable.
User avatar
k-ww
 
Posts: 1160
Joined: February 17th, 2011, 10:47 am

Re: Have any made a USB host to client using a single PIC?

Postby st2000 » February 12th, 2013, 6:26 pm

Yes, many Microchip processors can be used as clients. I think you need to stay at the 24F's and above if you want to run a USB host. So, yes, I could use a 24F as the USB host interface and pass off the data to something like a cheaper 18F and use that as a USB client. I was just looking for a one chip solution. I was thinking the USB client (peripheral) could be implemented in software.

Oh, I see the chips you suggest are only the USB part. Or USB to UART. Hum, didn't realize that existed. And now I'm wondering what exactly does that bring to the table. Hum, if there is a HW level shifting feature that needs to happen. Well. Then, I really can't run two USB ports on one PIC. As I do not believe any have more then one set of USB pins. Therefore none have more then one USB "HW level shifter".

Drats.
st2000
 
Posts: 1317
Joined: February 3rd, 2011, 6:10 pm

Re: Have any made a USB host to client using a single PIC?

Postby k-ww » February 12th, 2013, 7:42 pm

Oh, I forgot: Check the www.FTDIchip.com website - since the make USB chips, I think there is a combo one that does both host & client.

Yup, look at:

http://www.ftdichip.com/Products/ICs/VNC2.htm

Only bad thing is that it isn't a PIC [my favorite micros] :-(
User avatar
k-ww
 
Posts: 1160
Joined: February 17th, 2011, 10:47 am

Re: Have any made a USB host to client using a single PIC?

Postby UAirLtd » February 12th, 2013, 11:57 pm

FTDI's Vinculum 2 chips are great for this, they have two USB ports that can be either USB Host or Device, and come with a nice set of usage examples as well as a good collection of serial ports and GPIO options. It's a 16-bit core, which should be good enough for most things you might want to do.

I'm messing with one now, intending to add two USB Host ports for a new product. I haven't got around to getting them working yet since I'm waiting for a couple of 12MHz crystals that have been held up this week, but the rest of their circuit is straightforward enough. I'll be in a position to comment with my experience using Vinculum 2 later if you'd like.

Hint hint: get the 48-pin LQFP version if you're prototyping, for some reason that's the ONLY package version which doesn't require you to supply external capacitors and inductors to build a pi filter between the chip's internal 1.8V regulator output pin and the 1.8V input pin. See the note on page 72 of the manual.
User avatar
UAirLtd
 
Posts: 629
Joined: July 19th, 2011, 10:32 pm

Re: Have any made a USB host to client using a single PIC?

Postby st2000 » February 13th, 2013, 8:39 am

Hey, thanks guys - as usual I'm learning more about what's out there - which is great.

As I'm already felling stretched learning new stuff at work - I'm not too excited about picking up yet another uP. Add to that I'm only interested in a one off project. I confess spending a few more bucks on a 2nd PIC is more appealing then setting up a 4th, no make that a 5th SDK (Vinculum Software Tool Suite?) on my PC.

@UAirLtd, do let us know how your project turns out. How easy/difficult it is to use the FTDI processor.

-thanks again guys.
st2000
 
Posts: 1317
Joined: February 3rd, 2011, 6:10 pm

Re: Have any made a USB host to client using a single PIC?

Postby Adraen » March 20th, 2013, 5:19 am

Hi,

Did you had a look at http://www.lendlocus.com/?q=16fusb ? It's a USB library for PIC16F using bit banging to do the communication. It's quite slow but should probably be fast enough for a keyboard.
Adraen
 
Posts: 11
Joined: March 19th, 2013, 12:02 pm

Re: Have any made a USB host to client using a single PIC?

Postby st2000 » March 20th, 2013, 5:47 am

Interesting.

But making a quick pass at the web page, I don't see any USB HOST claims. So I am thinking while the PIC 16 might be able to look like a keyboard (act like a USB PERIPHERAL), it can not listen to a keyboard (act like a USB HOST).

Or did I miss something?

---

Oh, hang on, are you saying to use a PIC 24F class of processor for the USB host (hardware / software) and implement the USB peripheral (software only) using the code examples here intended for the PIC 16 class of processor? Ah, that is interesting.

-thanks
st2000
 
Posts: 1317
Joined: February 3rd, 2011, 6:10 pm

Re: Have any made a USB host to client using a single PIC?

Postby Adraen » March 20th, 2013, 7:23 am

Hi sorry wasn't really clear on what I was suggesting. So yes use a pic24 USB feature to do the USB host and bit bang the USB peripheral using some of the remaining pins.

From what I've seen bit banging USB is not that complicated if your clock is fast enough to have a decent number of instruction per bit ratio, in the PIC16 example it's a bit tricky because of the fairly slow clock but that might be simpler with a PIC24. I haven't looked around but someone probably already did some code to bit bang usb on PIC24.
Adraen
 
Posts: 11
Joined: March 19th, 2013, 12:02 pm


Return to Help Me! Software

Who is online

Users browsing this forum: No registered users and 1 guest