Hello, i am looking for a way to test MAX-485 , i do not have any idea how to do it , anyone can help me?
Hello, i am looking for a way to test MAX-485 , i do not have any idea how to do it , anyone can help me?
If you want to test RS485, then really you should use THREE or more devices.
Since RS485 is a multi-drop bus, you'll want to ensure that the data can be transmitted from any one node to every other node successfully.
One node will becomde the bus driving force by asserting the DE signal on the Max485 and de-asserting it on all the other nodes.
You can assert the !RE (Receive enable) signal on ALL the nodes, even the transmitting node at any time, even when transmitting. This allows the transmitting node to "read back" it's own transmissions. This is useful for detecting collissions on the bus.
For example if you send 0xff,0xff,0xff but read back something other than that, you can deduce that there is eithew a) A fault on the bus, or b)some other node transmitted at the same time.
The bus should be wired point to point, from one node to the next, but not as a "star".
Appropriate terminating resistors should be used on the nodes at the far extents of the bus, but not on the intermediate nodes.
I should add...
Use the appropriate size and guage of wire, connecting all the A's together and all the B's together.
A common ground is not necessary, since RS485 is a differential signal, however using a common ground can reduce current consumption.
Thanks for all that can you please send me a link or pdf for more explamation?
Yeah no problem, here it is:https://www.analog.com/media/jp/technical-documentation/data-sheets/1111.pdf
If you have any questions please feel free to ask - I use these chips in loads of things.
Also here's a diagram showing how to wire it up.
The double-s symbol means "long bit of wire"
and the A wire and B Wire should be a twisted pair.
Oh.. and there's one more thing...
You only need to connect 1 GPIO pin to DE and !RE - because DE is active-high and RE is active low, it means you can connect them both to the same pin. When you drive the pin HIGH you have a trasnmitter, when you drive the pin LOW you have a receiver ;-)
Thanks for that, i keep studying about that topic every day for some hours and now i know the concept but still idk how to add the ic itself , i want to start only with two ics to test them.
What am trying to say is how to communicate between an pc and pc using the ic , what is the connections and the wiring , what is the code or the procedures, all that i still dont know about , but the concept of RS-485 know i understand what it does,
The main point now is how to insert data to DI what do i need for that?
And also how to receive data from RO like how can i show the data coming out of this pin, what do i need to show these data? so i can compare it with the data i sent on DI (which idk yet how to do that) to ensure if the ic is working well or not.
Ah yeah - ok, so connecting a chip like this to a PC is not as easy as yuo might think.
That's because a PC does not have any GPIO pins, like an Arduino does, or a Raspberry PI.
So what you'd need is another chip first - which has USB and can be programmed to be a "CDC" device.
Such a chip might be the FT232R from FTDI
That will give you TX, RX pins, and a number of other programmable pins such as CTR, DTR, RTS, CTS - you are then able to use one of these as the DE/RE control. Then you can use any kind of serial terminal on a PC to send and receive via RS485.
The datasheet for THAT chip is at https://ftdichip.com/wp-content/uploads/2020/08/DS_FT232R.pdf and it includes (section 7.2) a schematic on how to make a PC to RS485 convertor! The chip which they call "SP481" in the example, could be replaced with a MAX485 as it has the same pinout.
Ok that will help a lot thanks, i will study that and will tell you about the news.
Ok good stuff i found that module https://handsontec.com/index.php/product/ft232r-usb-to-serialttl-converter-module/
will that work ?
Yip - that'll do it :-)
Yip - that'll do it :-)