1

I have 3 devices(GPS-Rx only, tft display-TxRx and a motor driver-Rx only) that connect only using uart. 2 of which only Tx, while one another has both Tx and Rx. I am using uart 0, for tx-rx peripheral. Flash mode and peripheral usage with device are separated with a push switch. I also have a micro sd card requirement, so pins of uart1 has to be changed from spi pins. I am using esp-idf and I am trying to use uart_set_pin. Now I have 2 questions,

  1. How do I set no pin for Tx? Setting "UART_PIN_NO_CHANGE" would set it only to default Tx pin.
  2. Can I use GPIO 16 and 17 for Rx pins of uart1 and uart2 respectively?
4
  • there is a SoftwareSerial library for Arduino on esp32 Commented Aug 31, 2022 at 5:32
  • Is there a way to workout with idf? Our project is bound to idf as it gives lot of configurable options. Commented Aug 31, 2022 at 7:47
  • 1
    the esp32 Arduino is based on IDF so the internals of the library have to by compatible with IDF. github.com/plerup/espsoftwareserial Commented Aug 31, 2022 at 9:13
  • :). I tested it. I did the following 1. Set Tx of uart1 and uart2 to UART_PIN_NO_CHANGE; 2. assigning the pin gpio 17 to Rx of uart1. 3. assign the pin gpio 16. Ran echo uart on uart 0 to test bidirectional test. Receive different texts over uart 1 and uart 2. It worked. Commented Aug 31, 2022 at 10:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.