Page 1 of 1

Serial port part add RS485 chip DE pin control

Posted: Mon May 08, 2023 12:15 pm
by SHIPC
When the TXD serial port is being sent, an I/O can automatically change to high level. When the TXD port is sent, it automatically changes to low level. In this way, you can control the sending and receiving of the RS485 chip

Re: Serial port part add RS485 chip DE pin control

Posted: Sun May 14, 2023 7:58 am
by NormanEstrada
SHIPC wrote: Mon May 08, 2023 12:15 pm When the TXD serial port is being sent, an I/O can automatically change to high level. When the TXD port is sent, it automatically changes to low level. In this way, you can control the sending and receiving of the RS485 chip
In RS485 communication, the TXD (transmit data) line is responsible for transmitting data from the sender to the receiver. To control the sending and receiving of data using the RS485 chip, you can utilize an I/O (input/output) line that automatically changes its level based on the activity of the TXD line.

Re: Serial port part add RS485 chip DE pin control

Posted: Thu May 18, 2023 10:57 am
by SHIPC
But my use of the following functions does not work:
digitalWrite(DE,HIGH);
Serial.println("hello");
digitalWrite(DE,LOW);


I have to do this by adding the DELAY function such as:
digitalWrite(DE,HIGH);
Serial.println("hello");
delay(10);
digitalWrite(DE,LOW);

Is there any way to automatically control the RS485 mode, rather than through the delay mode

Re: Serial port part add RS485 chip DE pin control

Posted: Thu May 18, 2023 11:05 am
by SHIPC
IN STM32CUBEMX I found the serial port automatic flow control function:
https://img-blog.csdnimg.cn/img_convert ... 075b4c.png

https://www.st.com/content/ccc/resource ... 055208.pdf

However, it is not supported in stm32duino

Re: Serial port part add RS485 chip DE pin control

Posted: Thu May 18, 2023 11:26 am
by fpiSTM

Re: Serial port part add RS485 chip DE pin control

Posted: Thu May 18, 2023 11:48 am
by SHIPC
This function is used to control CTS and RTS
But what I need is DE control which means that when the serial port sends data, the DE pin automatically changes to high level and then to low level after sending

Re: Serial port part add RS485 chip DE pin control

Posted: Thu May 18, 2023 1:29 pm
by Vassilis
An alternative way to connect the RS-485 transceiver is as follows, where the DE/RE pins are not used in the known way.
RS-485_transceiver.jpg
RS-485_transceiver.jpg (37.77 KiB) Viewed 1474 times
Source: https://www.waveshare.com/w/upload/1/1d ... ematic.pdf