Connecting an external USB breakout board.

Status
Not open for further replies.

androadi

Member
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? female-mini-usb-breakout-board.jpg
 
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.
 
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?
 
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.
 
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!
 
Status
Not open for further replies.
Back
Top