Teensy3X as serial communication device uart/ftdi

Status
Not open for further replies.

Duhjoker

Well-known member
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.
 
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
 
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.
 
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.
 
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?
 
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.
 
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
 
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
 
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
 
Regarding the example, which you access in Arduino by clicking File > Examples > Teensy > USB_Serial > USBtoSerial

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.
 
Status
Not open for further replies.
Back
Top