Half-Duplex Modbus Communication with RS485 Transceiver

Advertisements

Hello!

Recently, I have been trying to communicate with a solar charge controller I have (one of these https://www.epever.com/product/xtra-10-40a-mppt-solar-charge-controller/)..) I have learned that it uses Modbus over RS485. So, I purchased a modbus transceiver that uses a Max485 chip https://www.amazon.ca/gp/product/B09BKJ … UTF8&psc=1. I’ll need to pull off half-duplex communication using this chip. The transceiver has DE/RE signals which control whether data is being sent to the module or received from it. The issue I am having is that, I have no idea how to control these signals. If I do it from userspace, research has told me that it will be too slow (I need to operate at 115200 baud). I have tried using hardware flow control with GPIO17/16 as RTS/CTS, but it looks like that doesn’t do what I need. The RTS pin only changes state when the serial port is opened, not when sending/receiving data (also it goes low when the port is opened, thus disabling the transmitter). Any ideas on how to toggle the DE/RE pins when data needs to be sent?

Also, I am using Libmodbus, pigpio, and C.

submitted by /u/BadboyZ1299
[link] [comments]      



Author: AliensFaith
HighTech FinTech researcher, university lecturer & Scholar. He is studying his second doctoral degree at the Hague International University. Studying different fields of Sciences gave him a broad understanding of various aspects of life. His recent researches covered AI, Machine-learning & Automation concepts. The Information Technology Skills & Knowledge gave his company a higher position over other regional high-tech consultancy services. The other qualities and activities which can describe him are a Hobbyist Programmer, Achiever, Strategic Thinker, Futuristic person, and Frequent Traveler.

Discover more from Maheri Network

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version