ESP32-C3-WROOM02串口问题
ESP32-C3-WROOM02串口问题
串口设置如图,用串口调试工具发现, 开发板可以发送但是无法接收.
-
- Posts: 786
- Joined: Wed Nov 14, 2018 8:45 am
Re: ESP32-C3-WROOM02串口问题
不要重复发帖,有图贴图上来。
Re: ESP32-C3-WROOM02串口问题
- static void uart_init()
- {
- uart_config_t uart_config1 = {
- .baud_rate = 57600,
- .data_bits = UART_DATA_8_BITS,
- .parity = UART_PARITY_DISABLE,
- .stop_bits = UART_STOP_BITS_1,
- .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
- .source_clk = UART_SCLK_APB,
- };
- uart_param_config(UART_NUM_0, &uart_config1);
- uart_set_pin(UART_NUM_0, 12, 11, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
- uart_driver_install(UART_NUM_0, BUF_SIZE * 2, 0, 0, NULL, 0);
- }
- for(;;)
- {
- vTaskDelay(pdMS_TO_TICKS(200));
- ESP_ERROR_CHECK(uart_get_buffered_data_len(UART_NUM_0, (size_t*)&length));
- if(length>0)
- {
- len = uart_read_bytes(UART_NUM_0, starting_up, length, 30/portMAX_DELAY);
- vTaskDelay(pdMS_TO_TICKS(500));
- if(len>0)
- {
-
- Posts: 786
- Joined: Wed Nov 14, 2018 8:45 am
Re: ESP32-C3-WROOM02串口问题
我用C3mini的芯片就没问题,可以正常收发数据.换成WROOM的就不能接收了.我看了那个帖子,我已经用了read函数也是读不到
-
- Posts: 786
- Joined: Wed Nov 14, 2018 8:45 am
Re: ESP32-C3-WROOM02串口问题
uart_set_pin(UART_NUM_0, 12, 11, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
你再看看 TX/RX 管脚对不对。
你再看看 TX/RX 管脚对不对。
Re: ESP32-C3-WROOM02串口问题
名称 序号 类型1 功能
IO8 7 I/O/T GPIO8
IO9 8 I/O/T GPIO9
GND 9, 19P 接地
IO10 10 I/O/T GPIO10, FSPICS0
RXD 11 I/O/T GPIO20, U0RXD
TXD 12 I/O/T GPIO21, U0TXD
IO8 7 I/O/T GPIO8
IO9 8 I/O/T GPIO9
GND 9, 19P 接地
IO10 10 I/O/T GPIO10, FSPICS0
RXD 11 I/O/T GPIO20, U0RXD
TXD 12 I/O/T GPIO21, U0TXD
-
- Posts: 786
- Joined: Wed Nov 14, 2018 8:45 am
Re: ESP32-C3-WROOM02串口问题
RXD 11 I/O/T GPIO20, U0RXD
TXD 12 I/O/T GPIO21, U0TXD
用模组管脚,还是芯片管脚?
TXD 12 I/O/T GPIO21, U0TXD
用模组管脚,还是芯片管脚?
Re: ESP32-C3-WROOM02串口问题
我用的是官方的开发板,我程序里写的是12 11.但是12 11和GPIO21,GPIO20.我都尝试过.都是只有TX没有RX.
Who is online
Users browsing this forum: No registered users and 94 guests