Hey everyone, I am doing a project which is controlling an arduino using LabView 2014. All is good and well, but for a real life application I must have a longer than 4-5m USB cable connection. I've decided that a MAX485 IC will solve my problems. I have the following idea:
- My PC will use an FTDI (or other) USB to TTL breakout board.
2.The TTL signal will be fed to the MAX485 IC.
3.The first MAX485 will feed the freshly converted data to the second MAX485 IC.
4.The second MAX485 IC spills out data to the RX/TX pins on the arduino.
So my question is about synchronizing the two ICs. I know that the first has to be (lets say) HIGH and LOW, and the second must be inverted LOW and HIGH so communication can occur. First I thought about using the breakout boards RX or TX pin via a voltage repeater and feed it to the first MAX485 IC and also to the second one using an inverter. Also I thought about using a 555 timer set on about 115200 kHz to enable the first IC and again via a inverter to the second IC.
What do you think? Will this work, am I even close to figuring out how RS485 actually works? Please post any other methods You think are viable.
Check out some of the tech. articles RS485 info These guys do a pretty good job with some of their articles. RS485 has lots of potential and does work over pretty good distances, but you need to think about just how it all fits. These articles should give you some more insight into RS485 (I don't have much experience with it, just have found their articles helpful before).
You can just solder those pins together and use one pin to control the flow. HIGH is transmit, LOW is receive.
It is simpler to just purchase something with automated flow control. Or at least an integrated package. Here are some options.
You also need to think about how to prevent both sides from being in receive mode or transmit mode at the same time.
On the Arduino end I programmed it to set the flow control pin HIGH and delay(20) whenever it needed to send and used the flush command to make sure all data was sent before setting the pin low again.
I just purchased 5 converters from SerialComm because they have automatic flow control and I was tired of replacing fried MAX485 chips.
For my current application I can use a USB repeater, I got one for $4 on e-bay. But that's not the final solution I am looking for.
Henradrie, I've read the first article you provided and I have the MAX485 module. But as you stated, I have to figure out how to make one side receive and the other one transmit. The problem is that I can't program the arduino to do something specifically because of LabView. Using LabView, I have to program the arduino with a sketch called LIFA_base so I can communicate with it. That is why I asked if the two solutions I thought about were going to work. And I will repeat myself:
If I were to create a frequency near or equal to the baud rate(115200) and feed it to the first MAX485 and send it via another wire(I am going to use a LAN cable so I have plenty of those) and run it through a transistor inverter so the signal will tell the second IC to do the opposite of the first, will that work.