-2

I am converting a project that formerly used an Arduino Pro along with a Sparkfun Basic FTDI adapter to an ESP32 platform (DOIT DEVKIT V1). The serial adapter is not used to program/debug the target but rather as the data exchange channel (measurements from an array of pressure sensors).

Converting to the ESP32 I set up UART2 as a hardware serial port using the HardwareSerial class communicating with the host at 460800 baud. All works fine in the sense that an oscilloscope probe on the TX port of the ESP32 shows the expected activity, but I get nothing through the FTDI adapter, and I have h=now tried several, including two Sparkfun breakouts, one from Hiletgo, and a couple others. I get nothing in the serial monitor on a PC listening to the USB serial port, but the o’scope continues verifying that the ESP is sending the data through the designated TX port.

While I am obviously “concluding” I must be doing something wrong with the FTDI adapter(s), but I can't figure out what. The adapters are connected TX-RX / RX-TX with the ESP, GND is connected (and I tried with both external and USB supplied power). What might I be missing?

halfer
  • 19,824
  • 17
  • 99
  • 186

2 Answers2

0

Gustavo's advice was very good and let me to experiment.

First, I slowed the sample interval of the sensors down to 500 ms so I could get by with slower baud rates (the application ultimately requires 1 kHz sample frequency). Then, I dropped back to 9600 baud and things worked as expected, so I went up in multiples from there ( 19200, 13400, ...) until I got back up to 460800 baud. It turns out the FTDI breakout handled that baud rate just fine, but not the throughput. It worked OK up to about a 40 Hz sample rate (25 ms sample interval) but not any faster.

I get satisfactory performance with the 1 kHz sample rate (1 ms interval) at 460800 baud using the CP210x USB bridge built into the the DOIT board, but not through the "SparkFun FTDI Basic Breakout - 3.3V". It could be the breadboard wiring used to connect the breakout to the ESP board for testing, or maybe differences between the CP210x and the FTDI chip used by the breakout?

Anyway, thanks again for the tips - I learned a lot experimenting here and have ideas for how to get my project working.

-1

I would check some points, if you haven't yet

  • Have you tried lowest baud rate? Like 9600 or 115200?
  • About the voltage level, is your FTDI set to 3V
  • Are you using some flow control or parity bits?

Please let us know if you performed those tests.

halfer
  • 19,824
  • 17
  • 99
  • 186
Gto Carlos
  • 37
  • 5
  • Thanks for the quick reply and ideas. I tried 115200 - nothing lower yet but will. FTDI’s used were all set to 3.3V. I didn’t set the HardwareSerial port to use flow control, and I haven’t connected any of the flow control lines. I was actually wondering if I had to ground or pull one or more up to make it work, but again my experience with Arduino family has been that just connecting RX, TX and GND was enough to get the data flowing… – Robert Baldwin Apr 16 '23 at 00:43