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

Thread: Teensy 4.0/4.1 HOTAS Joystick

  1. #1
    Junior Member
    Join Date
    Sep 2020
    Posts
    3

    Teensy 4.0/4.1 HOTAS Joystick

    Greetings all, glad to be here -- I want to start by saying that I am very new to this world, so please use soft hands in your responses. I have experience in coding, but nothing like this, however, I am very willing to learn.

    The project that I am interested in executing is utilizing an off-shelf USB HOTAS (joystick and throttle) with a Teensy 4.0/4.1 in order to fly an RC airplane.

    If anyone has any starter information or prior experience utilizing USB joystick inputs with Teensy hardware -- I'd be very appreciative of some guidance. Some basic questions that I have are:
    1. "how does Teensy interpret USB signals"
    2. "how would Teensy be able to receive inputs from two user input devices (throttle and stick"
    3. "if Teensy is not the best venue for this, what in your estimation would be a better route?"


    Thank you very much for your time. I look forward to the responses.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,699
    You can probably plug in the Joystick and the like into a Host USB adapter for a T3.6, T4 or T4.1. The 3.6 and 4.1 are the easiest as they have a 5 pin connector
    That can go directly to a USB cable like the ones sold by PJRC: https://www.pjrc.com/store/cable_usb_host_t36.html

    The T4, is a little harder as the USB D+ and D- pins are SMT bottom pins and you need to route +5v and GND and usually best to have a power management chip... Not hard but easier with the other two which have this all built in.

    There is a library USBHost_t36 that supports a lot of different USB devices.

    There is some information in the thread: https://forum.pjrc.com/threads/49099...Host-Joysticks

    Not sure if we have tried your joysticks or not... As for multiple devices, you can plug in a hub, which will require you to add a HUB object to the sketch. You might take a look at the joystick example for the library.

  3. #3
    Junior Member
    Join Date
    Sep 2020
    Posts
    3
    I wanted to say thank you for responding so quickly!

    A couple questions...

    1. Why would I not be able to plug a USB hub directly into the USB port on the Teensy board? Is it not a I/O functionality?
    2. Can you elaborate on the D+- comment? I think you're saying that the joystick will require a 5V power input, but that is not compatible with a Teensy board. Is that correct?

    Apologies if these are super basic questions, but I appreciate any and all help you could provide. Thank you for those links as well.

  4. #4
    Junior Member
    Join Date
    Sep 2020
    Posts
    3
    So I did some reading and I think I figured out your comments --

    Am I to understand that the onboard micro-USB port does not have power management functionality and what you were saying is that the 3.6 and 4.1 boards offer this via the 5 pin interface?

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,699
    The USB connectors on your different Teensy boards is not setup to be a host, but is for being a client to a PC or the like. @Paul can explain this a lot better than I can, but will try to show the basics.

    The T3.6 and the T4.xs have a second hardware USB port on the main processor board, that we have software USBHost_t36 library that allows that port to create a Host. With some of my boards I have connections to these pins that go to a normal host mode USB connector (USB-A...)

    The T4.0's hardware is pretty simple, there are two pads on the bottom of the board that you can connect to for the D+ and D- pads... The USB connector typically takes two more wires. A +5v and GND.

    You can for example run wires directly from the VUSB (or VIN) pads of the Teensy to the power pin of USB and it can work. But a USB port from a PC or HUB can typically only supply so much amperage and if you exceed that the USB port may be turned off or... Plugging in some USB devices can cause a surge. To handle this better there are chips that are setup to better regulate the current draw...
    Both the T3.6 and the new T4.1 have this on the actual boards... The T4 does not. You can typically get away without it if you always have the device plugged in to the host. Also it is a lot simpler to either use the cable or use the 5 pin connector to go to another board...

    Here is a a partially populated board I right now using to try to debug our bluetooth support and trying the get an XBox One Controller to work.
    Click image for larger version. 

Name:	IMG_1229.jpg 
Views:	8 
Size:	107.6 KB 
ID:	21678

    If you look at a T3.5 versus a T3.6 the only visible differences between them is the marking on the processor chip and there are a couple of parts that are not populated on the T3.5... These are the same parts that you can for example add external to your own board with a T4.1 to give that same voltage handling... You see it in the different schematics. I highlighted the parts in a portion of the 4.1 schematic below:
    Click image for larger version. 

Name:	screenshot2.jpg 
Views:	7 
Size:	145.0 KB 
ID:	21680

    Hope that helps
    Last edited by KurtE; 09-10-2020 at 02:08 AM. Reason: Wrong photo

Posting Permissions

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