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

Thread: how to usb device serial output connect to teensy 4.0 usb

  1. #1
    Junior Member
    Join Date
    Apr 2022
    Posts
    2

    how to usb device serial output connect to teensy 4.0 usb

    Hi, I have a GPS which sends NMEA though it's USB port. Connecting this to windows pc it appears in devices as a com port.
    Next starting an app which can read this port NMEA is visible in the app.

    I currently have a teensy 4.0 board.

    My question is : how can I connect my GPS using it's usb port to the teensy board , so that I can receive the NMEA stream with it ?
    Do I need extra hardware and if so what ?
    Or can I connect the GPS directly to the usb port of the teensy 4.0 using a micro usb to micro usb cable ?

    thanks
    regards
    Sjord

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,019
    The Teensy main USB is in Device mode, as is the GPS. So, they won't see each other as devices only talk to a 'Host'.

    To have the T_4.0 see the GPS it would need to be put on the USB Host pads ( marked on the CARD under the device port ) with power and GND fed to the GPS. Then hopefully there is a way to get the T_4.0 to recognize and transfer data with the GPS. Various devices are supported - Mice and keyboards (wired and wireless) - Flash and HDD's. But each device like the GPS needs to be handled as needed and that work for that device may not exist.

    T_4.1 (and T_3.6) have dedicated pins (and power control hardware) to more easily interface the Host feature. It does work the same on T_4.0 - but involves soldering and wiring to the D+ and D- and then not having the power switch (not always needed for low power devices) to control power on current (IIRC) to the connected device. The GPS may need more power than can pass through the Teensy - so connecting a powered hub to the Teensy and putting the GPS on the Hub may be needed for good function.

  3. #3
    Senior Member pictographer's Avatar
    Join Date
    May 2013
    Location
    San Jose, CA
    Posts
    712
    If I recall correctly, I connected a Teensy 3.2 to a GPS using USB-Serial using no other hardware than a cable. It's possible I wired the GPS to hardware TX and RX pins of the Teensy, but I don't think so. I'd be surprised if this didn't work with the Teensy 4. I've got a Teensy 4. I'll see if I can find it and the GPS module.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,019
    The GPD used here was UART Rx/Tx - might be that GPS>USB>FTDI would just connect ... may do the same using USB Host mode to Teensy if it just SPEWS messages.
    But there can be interface software associated to edit config and control message timing and content.

    The unit SPEC/Info should spell that out.

  5. #5
    Junior Member
    Join Date
    Apr 2022
    Posts
    2
    Hi thanks for replies, I'll try to use the teensy usb host pads.

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,554
    Obviously the simplest way to connect would be if your GPS had some ttl level outputs, that you could connect up to a hardware serial port.
    (Maybe requiring TTL level shifter(s) if voltage difference).

    But as mentioned you should be able to connect up to the USBHost pins on the bottom of the T4. Better yet with 4.1. Which has pins setup to allows yo to use simple host cable like the one PJRC sells: https://www.pjrc.com/store/cable_usb_host_t36.html

    You will also need to provide your GPS a power connection as well as a common ground.

    Then once you have the connection, you should hopefully be able to plug it into the USBHost connection and use the USBHost_t36 library and setup a Serial object to talk to it. Hopefully it uses a USB To Serial connection device like FTDI that we code to recognize.

    And then you should be able to receive your input stream. As previously mentioned if your device requires some input from the host, you should also be able to output that over this serial connection as well.

Posting Permissions

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