RS485 Not working, What I'm doing wrong

Folks,

Using "shield" MAX485 TTL to RS-485 to communicate a Mega (Master) with a Micro (slave)

Test each sketch using the Serial Monitor and the Slave is sending the data as expected, and the Master is receiving the data as expected. But when I change to the RS485 shield, it appears that data is not being received or transmit or both.

I wired the Shields as per for half duplex communication. Triple check the connections and everything seems to be connected fine, but see no seral activity. I'm not using any resistors for the bus, none of the "tutorials", videos and connection diagrams showed or say anything about
adding resistors to the bus. What I'm doin wrong??

Below the Codes

Master:

const int Tx_Rx = 3; 


void setup() 
{
  pinMode(Tx_Rx, OUTPUT);
  digitalWrite(Tx_Rx,LOW);
  Serial.begin(9600);    // Local Serial cooms
  //Serial1.begin(9600);   // RS485 Comms

}

void loop() 
{
  Message_From_Slave10();
  //Message_To_Slave();

}

void Message_From_Slave10()
{
  digitalWrite(Tx_Rx,LOW);      // LOW = Receiving Data from Serial
  if(Serial.available())        // Check if there is Data in the serial buffer
    {
      if(Serial.read()=='<')      // New Message from Slave. 
        {
          int TargetAddress = Serial.parseInt();    // 
          if ( TargetAddress == 10)
          {
            Serial.println (" We have a message from Slave 10");
   
          }
        }
     }
}

Slave:

const int Tx_Rx = 12;

void setup() 
{
   pinMode (Tx_Rx,OUTPUT);
   //digitalWrite(Tx_Rx,LOW);
   Serial.begin(9600);    // Local Serial cooms
}

void loop() 
{
 digitalWrite(Tx_Rx,HIGH);   // HIGH = Transmitting Data to  Serial
 Serial.print ("<");
 Serial.print (10);
 Serial.print (";");
 Serial.print (0);
 Serial.print (";");
 Serial.print (0);
 Serial.print (";");
 Serial.print (0);
 Serial.print (";");
 Serial.print (1);
 Serial.print (";");
 Serial.print (0);
 Serial.print (";");
 Serial.print (1);
 Serial.print (">");
 Serial.println (" ");
 //digitalWrite(Tx_Rx,LOW);   // LOW = Receiving Data from Serial
 delay (5);

}

Can you provide a link to the RS485 shield you are using?

Are you sure your shield is using the hardware serial port for comms?

Can you provide a drawing of the wiring you have used showing the various connections?

@markd833
here is the connection schematic I used for half duplex mode

Yeah I know... instead connecting DE & RE to pin 2 as shown on the schematic I connected them to pin 12 on the slave and pin 3 on the master...that should not be a problem.
follow the link below for the shield
MAXRS485

You should not be powering the stepper with the Arduino, use an external power supply

Why not show that in your picture. Same as except cause confusion.

gilshultz,
I appreciate your concern but, I did not ask about the servos, I'm not even using them . That's the connection schematic I went by to do the RS485, so I modified to fit my application, I specify that I connected to pin2, that's irrelevant for the issue I'm having. Next time don't waste your time and refrain to answer only what is asked.

Master and slave should have common ground and that is not the case on your schematic with two Unos.

They why did you clutter the drawing with them. Maybe the best thing is to redraw it to show exactly what you have instead of playing guessing games.

You can't use the same Serial for RS485 and for printing message in the Serial Monitor at the same time

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.