UART TX Pin Configuration for ESP32-H2-Mini-1
Posted: Fri Jan 10, 2025 8:48 am
Hi!
I have been trying to run a code for my ESP32-H2-Mini-1 board. The code is supposed to send a byte via UART TX pin and I then want to view the sent byte on a logic analyzer. Now the problem is that no matter which pin I set for UART TX(e.g. 16, 12, etc), I always see the output on the actual TX pin on the board. However, when I try to set the actual pin for TX (GPIO24)as per documentation, I can still not see the correct data on the logic analyzer. I see an different value at every second whereas the actual value is supposed to be A.
My code is as follows:
I have also tried to connect the TX pin to RX pin and then check the data, but the board didn't boot in this scenario.
I have connected to the board via USB-C to USB-C cable on its UART port. I am running the code on Arduino IDE. Also, I'm using Logic 2 to view the data.
Can you please help me figure out the issue?
I have been trying to run a code for my ESP32-H2-Mini-1 board. The code is supposed to send a byte via UART TX pin and I then want to view the sent byte on a logic analyzer. Now the problem is that no matter which pin I set for UART TX(e.g. 16, 12, etc), I always see the output on the actual TX pin on the board. However, when I try to set the actual pin for TX (GPIO24)as per documentation, I can still not see the correct data on the logic analyzer. I see an different value at every second whereas the actual value is supposed to be A.
My code is as follows:
Code: Select all
// UART port and pins definitions
#define UART_RX 23
#define UART_TX 24
// Create object for UART communication
HardwareSerial radarComm(2); // Using UART0 for communication
void setup()
{
// Initialize serial communication for debugging
Serial.begin(115200);
// Serial.println("Info: Initalizing ESP32...\n");
// Initialize UART0 for radar sensor communication
radarComm.begin(9600, SERIAL_8N1, UART_RX, UART_TX);
// Serial.println("Info: Radar sensor communication initialized.\n");
}
void loop()
{
// Send a simple character
radarComm.write('A');
Serial.println("Sent: A");
// Add a 1 second delay in transmission
delay(1000);
}
I have connected to the board via USB-C to USB-C cable on its UART port. I am running the code on Arduino IDE. Also, I'm using Logic 2 to view the data.
Can you please help me figure out the issue?