RS485 Pins

fahadmirza
Posts: 2
Joined: Tue Sep 22, 2020 1:55 am

RS485 Pins

Postby fahadmirza » Sat Oct 03, 2020 8:16 am

I am trying to communicate with an RS485 device using ESP32-Wroom module. I wanted to try the uart_rs485_echo example from esp-idf first. But I am confused about the pin mapping. From the example I see:

Code: Select all

--------------------------------------------------------------------------------------------------------------------------
  | ESP32 Interface       | #define            | Default ESP32 Pin     | Default ESP32-S2 Pins | External RS485 Driver Pin |
  | ----------------------|--------------------|-----------------------|-----------------------|---------------------------|
  | Transmit Data (TxD)   | CONFIG_MB_UART_TXD | GPIO23                | GPIO20                | DI                        |
  | Receive Data (RxD)    | CONFIG_MB_UART_RXD | GPIO22                | GPIO19                | RO                        |
  | Request To Send (RTS) | CONFIG_MB_UART_RTS | GPIO18                | GPIO18                | ~RE/DE                    |
  | Ground                | n/a                | GND                   | GND                   | GND                       |
  --------------------------------------------------------------------------------------------------------------------------
But in the datasheet GPIO18, GPIO22, and GPIO23 doesn't have RTS, RXD, and TXD functionalities, respectively.

Image

What am I missing?
Attachments
Untitled.png
Untitled.png (28.12 KiB) Viewed 3000 times

User avatar
ESP_krzychb
Posts: 396
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: RS485 Pins

Postby ESP_krzychb » Sat Oct 03, 2020 7:24 pm

Hi fahadmirza,

You can map specific non default pins as UART TxD, RxD, RTS and CTS.
This is done in the example using uart_set_pin() function.

fahadmirza
Posts: 2
Joined: Tue Sep 22, 2020 1:55 am

Re: RS485 Pins

Postby fahadmirza » Sun Oct 04, 2020 6:07 am

Did you mean I can use any other pins?

Who is online

Users browsing this forum: Bing [Bot], metala and 242 guests