Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Connecting an external USB breakout board.

  1. #1
    Junior Member
    Join Date
    May 2019
    Posts
    5

    Connecting an external USB breakout board.

    I want to connect an external USB mini breakout board to Teensy 3.2 to connect a keyboard. Which GPIO pins should I connect the D+ and D- pins (from the breakout board) to?Click image for larger version. 

Name:	female-mini-usb-breakout-board.jpg 
Views:	2 
Size:	30.5 KB 
ID:	16592

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Keyboards are USB devices, which only work with a USB host. Teensy 3.2 is a USB device, so this can’t work no matter how you connect the wires. USB devices can’t talk to each other. You need a host port.

    Teensy 3.6 is currently the only Teensy with a host port.

    There are also host shields which add a host port. But using 3.6 would be simpler, and the host port on 3.6 performs much better than the host shields.

  3. #3
    Junior Member
    Join Date
    May 2019
    Posts
    5
    I am doing a school project in which the restriction is to use only Teensy 3.2. So you recommend using a USB shield instead of a USB breakout board?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Yes, in that case get a host shield and use the UHS20 or UHS30 library. Or get an old PS/2 keyboard if USB isn't a hard requirement, and use PS2Keyboard lib.

    Here's a copy of the USB 2.0 spec. You can also get it at www.usb.org, but it's a challenge to find the PDF since it's bundled with lots of other files.

    https://www.pjrc.com/teensy/beta/usb20.pdf

    This PDF is 600 pages, but chapter 4 is only about a dozen pages and has the most important introductory info about USB. I highly recommend you read at least part of chapter 4. The most important concept of USB is the difference between "host" and "device". If that's not clear yet, read chapter 4. You'll probably end up saving yourself a lot of time and trouble, any maybe money too, if you clearly understand host vs device before going any further. Knowing this stuff will also make using the libraries easier, even if you don't end up needing to write any low-level code.

    As a side benefit, when you're talking with other people about USB, you can quickly get a feeling for whether they really know anything based on their understanding of host vs device, endpoints, control/bulk/interrupt/isochronous, and other key concepts. Chapter 4 and maybe the first part of chapter 5 is where you get that sort of info.

  5. #5
    Junior Member
    Join Date
    May 2019
    Posts
    5
    Using USB keyboard is not a restriction. I tried using a PS2 converter with my USB keyboard but the example program doesn't recognize any keystroke. Do you think this is the same problem as you mentioned in your first post? And this means I should use only a PS2 based keyboard with a PS2 connector?

    Thank You!

Posting Permissions

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