I've configured UART2 to use GPIO pins 12-TX 13-RX and the UART functions seem to be working, but the performance is slower than expected. I decided to put a scope on the UART2 RX and TX pins and I noticed an expected pulse with no transactions to the UART? I'm not reading or writing anything to the UART so I was expecting the pins to remain idle. I'm noticing the same behavior on UART1 which is using pins 4-tx 5-rx. I can't understand where the pulses are coming from, but I've attached an image of the scope trace hoping someone could help explain what's going on.
Below is the example of the UART2 driver, UART1 driver is done the same way with a queue.
int uart2_init(void)
{
int uart_num = UART_NUM_2;
uart_config_t uart_config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 122,
};
//Set UART parameters
uart_param_config(uart_num, &uart_config);
//Set UART log level
esp_log_level_set(TAG, ESP_LOG_INFO);
//Install UART driver, and get the queue.
uart_driver_install(uart_num, BUF_SIZE * 2, BUF_SIZE * 2, 10, &uart2_queue, 0);
//Set UART pins
uart_set_pin(uart_num, (12), (13), (14), (15));
return uart_num;
}
unexpected pulse on GPIO pins configured as UART?
unexpected pulse on GPIO pins configured as UART?
- Attachments
-
- scope capture of uart. Rx and TX have the same pulse
- esp32-uart.jpg (175.6 KiB) Viewed 3235 times
Who is online
Users browsing this forum: No registered users and 90 guests