Arduino: RS485 full-duplex using MAX488

Control Boards, Controllers, Tethers, Ect.
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: Arduino: RS485 full-duplex using MAX488

Post by KR2_Diving »

hbecem wrote: I tried the same idea you did and I used a max485 driver with easy transfer library using serial N°1. but no synchronisation entre surface arduino card and subsea arduino card.
Hello hbecem,
Please keep in mind that the max485 and max488 are two completely different chips, and their pinout is different as well. You will want to be sure that your pin out matched the data sheet for your IC.

Assuming that you have the correct wiring, it is also important to note that the max488 allows for full duplex with out having any special code to determine which direction the data is flowing. The max485 is only half duplex and will require you to set the directing or "data flow" prior to sending any data. (or require you to double up on the circuit using a total of 4 max485 to achieve full duplex).

One method you could use to check if it is your code or the wiring is to simply bypass the max485 chip. If you connect your Arduino1 Tx to Arduino2 Rx and Arduino1 Rx to Arduino2 Rx, you should be able to transfer the data. (Correct me if I am wrong, but this direct connection is actually full duplex, so errors in your code that determine the direction of flow may not be detected in this sense...)

Anyway, I have a build night planned for tonight so I will work on cleaning up and commenting my code (specifically relating to the communication) and post that on here when it is complete.
hbecem
Posts: 4
Joined: Apr 14th, 2013, 11:05 am

Re: Arduino: RS485 full-duplex using MAX488

Post by hbecem »

Hi KR2_Diving,

I finish today evening writing my codes for both surface and subsea Arduino Cards but some times I get a bad value sent from surface arduino to subsea one. I don't know if the problem is in "Easy Transfer" library or in the specification of communication wires which i used. anyway, waiting for your news and keep in touch to share our codes.

thanks in advance
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: Arduino: RS485 full-duplex using MAX488

Post by KR2_Diving »

Hey hbecem,
I have posted some notes and my code over in my build thread. HERE

This includes the EasyTransfer Library and full duplex RS485 Coms via 2 MAX488 ICs.

Hope this helps!

Ryan
"KR2_Diving"
hbecem
Posts: 4
Joined: Apr 14th, 2013, 11:05 am

Re: Arduino: RS485 full-duplex using MAX488

Post by hbecem »

Hi rayan,

Thanks for your code and hope it was well running. for me i am trying to establish full duplex mode with two max 485, until now i receive random value. When i finish i'll send my code and the configuration of my future ROV.

keep in touch
hbecem
Posts: 4
Joined: Apr 14th, 2013, 11:05 am

Re: Arduino: RS485 full-duplex using MAX488

Post by hbecem »

Hi,

Sorry I mean 4 max 485 ICs. Untill now still have some bugs. I am trying to optimize the code for good response.
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: Arduino: RS485 full-duplex using MAX488

Post by KR2_Diving »

hbecem wrote: Sorry I mean 4 max 485 ICs.
I was wondering!?! :lol:
User avatar
orangeltr456
Posts: 20
Joined: Jul 5th, 2013, 10:44 am

Re: Arduino: RS485 full-duplex using MAX488

Post by orangeltr456 »

I know this is an older post. But maybe there is still some value in this.

So I have made some circuits with 2 pairs of max 485 ics to hook up to arduino with only 4 wires power ground rx and tx . the other 4 pins go to 2 twisted pairs in a cat5e cable. and on the other end is a similar board just the rx and tx is reversed. Image

Here is the original rats nest on breadboards. worked well
Image

original drawing
Image

all hooked up
Image

pin out
Image

and final product
Image

as you can see in the diagrams pins 2 and 3 on the max 485 chips are always ether sending or receiving depending on if it is one that is grounded or pulled up to 5 v . The idea is to always have full duplex the only reason I did it this way is because I ordered the wrong chip originally but they are cheep and this was easy to do. essentially this is the same as having the RX hooked to TX and vise verse. additionally you can see the pins are hooked to 11 and 10 . I have theses set up as soft serials so we can still use the pc that is connected to the rx and tx for debugging via serial monitoring. The good news is I am able to run it over 1000ft of cat5e no problem.

I would like to add leds to this bored to monitor data activity but I am not sure how to go about this. I would like to put a green on send and red on receive on the arduino side of the max 485 because the tx and rx lights are not used in soft serial mode.

Thanks for any help.

ps. I am not that good at the programming part for communications. so i might be asking some questions when I start to actually code for the final. right now it is running a simple send from one pc's serial monitor and is pops up on the other pc. and you can im basically wired. kinda cool I thought
Citrushund
Posts: 14
Joined: Nov 25th, 2012, 12:27 pm

Re: Arduino: RS485 full-duplex using MAX488

Post by Citrushund »

Thanks alot for the info, i am now using 2 x MAX488 ;) Great work
Post Reply