Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 31

Thread: USB Host Status?

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    1

    USB Host Status?

    Just wondering what the current state of using a teensy 3 as a USB host is?

  2. #2
    Junior Member
    Join Date
    Jan 2013
    Posts
    2
    Paul, are there any news about USB host mode on a teensy3? Id need it for an ADK application.

    Thanks!

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,174
    I have not yet worked on USB host, and honestly I'm not planning to work on it until at least the summer. Several other big things are planned first....

  4. #4
    Junior Member
    Join Date
    Oct 2012
    Posts
    19
    I'm also interested in USB host, as I want to make a device that intercepts mouse movement and turns them into keystrokes. So I'll need USB host to plug their mouse into, and USB client to plug into their computer.

  5. #5
    There is this USB host shield: http://www.pjrc.com/teensy/td_libs_USBHostShield.html
    But it doesnt work with teensy 3.0. Imo i would rather use this shield instead of teensy 3.0 built-in host feature. Are there plans for supporting this shield on teensy 3.0 ?
    No hurry, Im just asking.

  6. #6
    Junior Member
    Join Date
    Mar 2013
    Posts
    1
    Programming a project using USB host mode will require a second Teensy 3.0 and a board-to-board link using the I2C pins (2 wires and ground), to provide a path for the Arduino IDE to upload code.
    Is this upload-over-I2C method ready to go, or not going to happen until USB Host is ready?

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,174
    The upload via I2C is definitely not ready.

  8. #8
    Junior Member
    Join Date
    Nov 2012
    Posts
    7
    Just adding +1 to this thread. Id like to connect a USB wifi radio (they're so small these days!) to the teensy 3 to build a tracking device which sends reports over an (unencrypted) access point.

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,174
    I don't want my reply and this question to give you any false impression I'm currently working on host support or that I might do so soon. I'm not, and I have several other things planned before even beginning any work on host support.

    But with that in mind, I am curious if you could post the technical details of this USB Wifi product. Does it have a well documented protocol? When (or if) USB host support exists, that doesn't necessarily mean it will have drivers for nice Arduino-like APIs to actually use most USB devices. Writing such drivers and APIs is a LOT of work. But even that is pretty much impossible unless the devices use known protocols. Many cheap projects on the market have proprietary protocols and generally only work with Windows using the driver published by the manufacturer.

  10. #10
    How about this USB host shield: http://www.pjrc.com/teensy/td_libs_USBHostShield.html
    Any news for this?

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,174
    I actually started fiddling with the host library a few weeks ago. If you want to play with some utterly untested and unlikey-to-work (but at least compiles) code, here it is:

    https://github.com/PaulStoffregen/USB_Host_Shield_2.0

  12. #12
    Thanks. I will try that library when i have some time. Nice to hear that you have at least worked with it.

  13. #13
    any recent developments? I think I'm gonna start looking into this. I've never done a USB project before, what is a SIMPLE ( and cheap) device to use for testing?

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,174
    Quote Originally Posted by btmcmahan View Post
    any recent developments?
    No, nothing new since message #11 in this thread.

  15. #15
    USB host shield works with that modified code Paul provided. Well at least i have succesfully connected Dualshock 3 and xbox 360 controllers with that.

    I quess this is something that we cant do ourself. Usb should be modified to work as a host, which means rewriting usb code completely(?). And programming over I2C is not done yet, which propably is not easy and quick job to do(?).

  16. #16
    Quote Originally Posted by W11cE View Post
    USB host shield works with that modified code Paul provided. Well at least i have succesfully connected Dualshock 3 and xbox 360 controllers with that.

    I quess this is something that we cant do ourself. Usb should be modified to work as a host, which means rewriting usb code completely(?). And programming over I2C is not done yet, which propably is not easy and quick job to do(?).
    I'm curious, I'm looking at connecting an xbox controller to it, how did you manage the power situation?
    Did you use the full size shield or the mini one?
    Did you end up running vbus at 3.3v or 5v?

  17. #17
    Mini version. On host shield i cutted VBUS jumper and connected VBUS pad to Vin on teensy 3.0. Vin is connected to 5V (if you have not cutted VUSB pad).

  18. #18
    Paul, I'm sorry but your code doesn't compile for me. At least, the usbPS3 example doesn't compile for me.
    Do you use arduino IDE for this, or something else?
    Last edited by btmcmahan; 09-13-2013 at 12:18 PM.

  19. #19
    Got this compiling & downloaded, I had to update to the Arduino 1.05 IDE & reinstall the Teensyduino files.

    Here's my next question:

    What pins are you using on the USB host? I have the full version for the mega, ICSP header has SCK, MOSI, MISO, and Reset(?)

    What pin, on the USB Host Sheild is used for the SlaveSelect?
    Click image for larger version. 

Name:	sku_142010_1.jpg 
Views:	245 
Size:	68.0 KB 
ID:	931
    Name:  arduino-icsp-programming-header-pinout.png
Views: 3703
Size:  9.0 KB

    Are there other pins that MUST be used?

    And, I think I am correct to assume you are using the basic Teensy3.0 spi pins...
    10 = SS
    11 = MOSI
    12 = MISO
    13 = SCK
    Last edited by btmcmahan; 09-14-2013 at 12:27 AM.

  20. #20
    This is the wiring tutorial for older teensys: http://www.pjrc.com/teensy/td_libs_USBHostShield.html

    And i used those basic teensy 3.0 SPI pins. This is the shield we are talking about here: http://www.circuitsathome.com/produc...duino-pro-mini
    Dont know about that shield.

  21. #21
    Okay, so I got the USB Host Shield Mini & the full size USB Host Shield.

    I got the Mini Shield + Teensy3 working with the Teensy3.0 lib (PS3USB example) provided by Paul.

    However, there seems to be some issue when using the bluetooth dongle.

    When I use the full size shield + Mega1280 + original arduino lib I can get the bluetooth dongle to work (with a ps3 controller).
    When I use Paul's lib, with the same full size shield + Mega1280, it doesn't work.

    Paul, what modifications did you make to the original library? I've been comparing some lib files, and I haven't found my issue yet.
    Anyone see whats going on here?

    Here's what the terminal shows:

    Class of device: 00 05 08
    Incoming Connection Request
    HCI event error: 06
    Last edited by btmcmahan; 10-06-2013 at 08:15 PM.

  22. #22
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,174
    Does the host shield library work at all on Teensy3 for you?

    You can see the specific changes I made here (the 6 commits on May 29, 2013)

    https://github.com/PaulStoffregen/US...commits/master

    Recently I've exchanged a few private emails with Kristian Lauszus, who maintains that library. He's been working to merge some of my changes to the official library. Here's a branch he created to experiment with Teensy3 stuff.

    https://github.com/felis/USB_Host_Shield_2.0/tree/arm

    Unfortunately, I can't dedicate more engineering time to this library right now. I'll probably fiddle with it again in a couple months.

    In the meantime, I'm going to send a Teensy3 to Kristian. I don't know if he'll have much time either, but he is interested in adapting the library to more boards and using Teensy as the first step to making it work on more ARM-based boards.

  23. #23
    The teensy3 does work with the lib, I connected the PS3 controller when I plug it in with USB.
    It also partly works with the Bluetooth Dongle, it recognizes the dongle, and attempts to connect to the controller, but it doesn't connect and gets this message:

    Class of device: 00 05 08
    Incoming Connection Request
    HCI event error: 06

  24. #24
    Okay, I got it working, here's what I did:

    1st) I started with the USB_Host_Shield_2.0 lib from the link you (Paul) just posted.
    2nd) I added Teensy 3.0 SPI to usbhost.h
    3rd) I added Teensy 3.0 pins to avrpins.h

    Paul, I did not do any of the other four edits you did. I wanted to add JUST pin support, and see what happened.

    I can now use USB Host Mini + Teensy 3.0 with PS3 Controller (both USB & Bluetooth)
    I can now use USB Host STD + ATMege1280 with PS3 Controller (both USB & Bluetooth) with the same lib.

    I don't know what was the cause of the problem (and as usual I don't care) but this seems to have fixed it.

  25. #25
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,009
    Quote Originally Posted by btmcmahan View Post
    Okay, I got it working, here's what I did:


    I can now use USB Host Mini + Teensy 3.0 with PS3 Controller (both USB & Bluetooth)
    How did you power/wire the USB host mini to the teensy 3? I have just done some experiments with Sparkfun USB host shield and Arduino meg2560. To get a Logitec joystick to work, I had to provide 7.5v to the DC input jack on the 2560 board. I presume I'll need to get the 3.3v USB Host mini for the teensy 3, but I worry about the 5v power required .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •