m5stack / M5Stack-Camera

Base espressif esp32-camera
200 stars 104 forks source link

How to set TXD/RXD/RTS/CTS for UART #7

Open Herwey opened 5 years ago

Herwey commented 5 years ago

Hi Now I am using M5 model A for UART, how to set TXD/RXD/RTS/CTS ?? I set it as below:

define ECHO_TEST_TXD (28)

define ECHO_TEST_RXD (14)

define ECHO_TEST_RTS (12)

define ECHO_TEST_CTS (13)

But it not worked very well

EeeeBin commented 5 years ago

In uart branch, test it https://github.com/m5stack/m5stack-cam-psram/blob/uart/main/main.c#L123

Herwey commented 5 years ago

Thanks ! I used this , but nothing printed in serial....

EeeeBin commented 5 years ago

https://github.com/m5stack/m5stack-cam-psram/blob/uart/main/main.c#L132 Serial print in tx=13, rx=12, not in usb-c bus

Herwey commented 5 years ago

I see, I used "make monitor". When I open a serial tool, I set the "baud_rate = 921600", it was wrong, it's not as below uart_write_bytes(UART_NUM_1, (char )tx_buffer, 7); uart_write_bytes(UART_NUM_1, (char )fb->buf, fb->len); When I set "baud_rate = 115200", I can see the print info, but not serial.Right?

Herwey commented 5 years ago

I set the pin as below: uart_set_pin(UART_NUM_0, 13, 12, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); It can send the data from serial, but it can't read the data from serial. emmm...