Why does the ESP32-PICO-D4's UART Port U2TXD/ U2RXD disrupt the Bluetooth communication?
Posted: Tue Oct 18, 2022 8:19 am
Hello,
In one of my prototype designs, I used the ESP32-WROOM-32D's U2TXD/U2RXD serial port to communicate with another MCU and the U0TXD/U0RXD pins to program it with an FTDI board and read serial data over UART (Arduino IDE, Serial Monitor). I also used the Bluetooth communication to send some data to my PC. It worked very well. But now I want to use the ESP32-PICO-D4 in my final design. I also have a development board (ESP32-PICO-KIT) for it and I have tested the same code with PICO. The problem is that my PC can no longer discover the Bluetooth connection. If I, however, comment the declaration of the U2TXD/U2RXD serial port (line 7 of the code), my PC can detect the Bluetooth device. Any idea why it is behaving like that and how to fix it?
Thanks
My code (Arduino IDE):
In one of my prototype designs, I used the ESP32-WROOM-32D's U2TXD/U2RXD serial port to communicate with another MCU and the U0TXD/U0RXD pins to program it with an FTDI board and read serial data over UART (Arduino IDE, Serial Monitor). I also used the Bluetooth communication to send some data to my PC. It worked very well. But now I want to use the ESP32-PICO-D4 in my final design. I also have a development board (ESP32-PICO-KIT) for it and I have tested the same code with PICO. The problem is that my PC can no longer discover the Bluetooth connection. If I, however, comment the declaration of the U2TXD/U2RXD serial port (line 7 of the code), my PC can detect the Bluetooth device. Any idea why it is behaving like that and how to fix it?
Thanks
My code (Arduino IDE):
Code: Select all
#define RXD2 16 // UART2 of ESP32
#define TXD2 17 // UART2 of ESP32
#include "BluetoothSerial.h"
BluetoothSerial SerialBT;
void setup() {
Serial.begin(115200); // Print over UART
Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2); //Serial2.begin(baud-rate, protocol, RX pin, TX pin); From the PIC MCU
SerialBT.begin("AAAA");
}
void loop() {
//while (Serial2.available()) {
char sensor_data= Serial2.read();
Serial.print(sensor_data);
SerialBT.print(sensor_data);
}
}