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

Thread: Teensy3X as serial communication device uart/ftdi

  1. #1
    Senior Member Duhjoker's Avatar
    Join Date
    Aug 2016
    Posts
    430

    Teensy3X as serial communication device uart/ftdi

    Can the teensy3X's be used as bridge serial communication devices such as UART/FTDI? For example....

    I would like to upgrade the firmware on an RC radio using the teensy.

  2. #2
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    439
    Of course, the EchoBoth example is included in every Teensyduino install.

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    5,194
    Myself and others have done just that for programming an ESP8266. Even down to setting control/reset/program pin levels and then taking the incoming USB data and sending it out Serial# to the TTL pins. As long as you are connecting to a 3.3v device with TTL serial and can make the device ready to receive and then transmit properly it could work.

    What I had working (modified from FrankB code) for that ESP case is here if it helps: S2FB_Proxy_jan31b.ino

  4. #4
    Senior Member Duhjoker's Avatar
    Join Date
    Aug 2016
    Posts
    430
    Is there a tutorial for this? Can you link me? Or do you mean as an included example. The actual board I'm using is a teensy3.6 if that helps.

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    5,194
    Quote Originally Posted by Duhjoker View Post
    Is there a tutorial for this? Can you link me? Or do you mean as an included example. The actual board I'm using is a teensy3.6 if that helps.
    Not sure if you are replying to defragster or Epyon? There is an example that just does ECHOBOTH - and the link I gave shows setting the Teensy up for ESP8266 programming - Serial Monitor - used for debugf before upload - has to close and then doProgram() is run and everything coming to Teensy over USB is Echoed out to Serial# to program attached ESP.

    Use for programming the Radio will be up to the details of doing that and how it is done.

  6. #6
    Senior Member Duhjoker's Avatar
    Join Date
    Aug 2016
    Posts
    430
    Sorry i posted after defragster but was meant for either. I don't have an esp8266 just a teensy3.6 so I would need to know how to set up a TX and RX line from the teensy3.6. I found this and this...

    https://forum.pjrc.com/threads/27940...UART-converter

    https://www.pjrc.com/teensy/td_uart.html

    All I need is a tx line RX line and ground. The Mod page can be found here...

    https://github.com/benb0jangles/FlySky-i6-Mod-

    If you look at the third link you can see how it's connected.

  7. #7
    Senior Member Duhjoker's Avatar
    Join Date
    Aug 2016
    Posts
    430
    Ok I think I need to use the USB to serial example since i will be using it that way. So I need to use serial2 since my teensy's 9 and 10 pins are readily available and so I don't have to dismantle my game console. Am I to understand that I just need to change serial1 to serial 2 in the USB to serial code example and it will automatically use the serial 2 pins?

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    5,194
    That seems correct - Serial2 just connect to those pins and GND - with RX's crossed to TX's unless they are showing where they work and not what they are. I followed one link from the link and didn't see any other details so I can't see more than that as far as what you run on the PC to spit out the code and control the process after getting into the Menu to prep the controller for the update. You'll need to set the proper baud rate in Setup() - which I didn't see noted.

  9. #9
    Senior Member Duhjoker's Avatar
    Join Date
    Aug 2016
    Posts
    430
    Thank you!!! I think that did the trick. Now when I plug it into my computer it shows as lpt & com and shows up as com 3

  10. #10
    Senior Member Duhjoker's Avatar
    Join Date
    Aug 2016
    Posts
    430
    ok wait just a sec......

    Should it show up in device manager as a Universal Serial Bus controller or as lpt&com when plugged into the computer

  11. #11
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    5,194
    It will show up like USB Teensy always does if programmed the same way. It will be visible as a COM# port that the uploader software will need to use with SerialMonitor closed

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    16,312
    Regarding the example, which you access in Arduino by clicking File > Examples > Teensy > USB_Serial > USBtoSerial

    Quote Originally Posted by Duhjoker View Post
    Am I to understand that I just need to change serial1 to serial 2 in the USB to serial code example and it will automatically use the serial 2 pins?
    Yes. In this particular case, you'll find this near the top of the code:

    Code:
    // set this to the hardware serial port you wish to use
    #define HWSERIAL Serial1
    If you read the rest, you'll see "HWSERIAL" appears in many places. This was done to make editing for a different serial port as easy as possible.

    In other programs where this isn't done, you'd need to find every "Serial" or "Serial1" and change them all. But this example as a single #define for you to edit.

Posting Permissions

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