Hi, I am a beginner in programming. I am doing a project in which I have to display some values/Numeric data from Arduino to Weinteck HMI means displaying some counter values when these values get updated. At the same time, I want to control my stepper motor from the same HMI i.e setting the RPM of the motor from the HMI. Is it possible to do it using one Arduino only?
over what link and with which protocol?
links to your hardware spec would help
Modbus protocol using Rs485
To answer the title of your post, you can't send data bidirectionally at the exact same time, as RS485 is half duplex. You need a master that "polls" a slave, or multiple slaves, for data. That means the master sends a request for data to the slave, the master waits for this data to be sent, and the slave sends the data during this waiting period.
Example of an RS485 master and slave protocol, along with a library, can be found here: Gammon Forum : Electronics : Microprocessors : RS485 communications
To answer the post more directly,
This is RS485; Master Talks while Slave listens. Since the TTL/RS485 transceiver can only be enabled for one direction, there's no way for the receive side on your device to hear anything while it's send side is talking.
That is, unless your device has two complete serial port implementations, and you set one up to be RS485 listener-only while the other acts as your Master/Slave port. Then, you could listen on the second port to hear what your first port is transmitting. However, I cannot envisage a use case where that would be useful.
When you say "protocol", I understand that it is about the pre-negotiated rules of communication network -- UART, I2C, or SPI.
It is not clear to me what you have meant by "link".
For a network with just 2 boards, I believe you only actually need 1 hardware UART on each MCU for this. For example, each arduino has a separate MAX485 module on the RX pin (set to receive mode permanently) and the TX pin (set to transmit mode permanently). So there are 4 * MAX485 chips in total. Such a configuration is called RS422:
URL, website.
A post was split to a new topic: Master and slave at the same time
if you have a microcontroller with two hardware serial ports there should be no problem supporting two RS485 interfaces - I have done this in an application where two RS485 devices used different protocols
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.