RS485 Communication between 2 arduino uno's

My project demands multiple softwareserial ports to receive data from multiple sources. I have already used up pins 2,3,4 . What other digital pins can I use for RS485 communication?

My project demands multiple softwareserial ports to receive data from multiple sources.

You do know that if you use multiple SoftwareSerial instances, only one can be listening at a time, don't you?
SoftwareSerial has several other limitations/design flaws that make it a bad choice for most purposes other than debugging. If you need several RS-485 connections use a Mega2560 which has 4 serial interfaces in hardware.

I have no problem in receiving data one serial port at a time , moreover ,I have to communicate over large distances , so I had no choice other than arduino. Can I not use any of the other digital pins on the uno?

no choice other than RS485 mistake!!!

Can I not use any of the other digital pins on the uno?

Yes, on the UNO you can use any other digital pin as all of them are able to generate a PCI (pin change interrupt), this is relevant for the SoftwareSerial receive pin.

Do you tell us what data you’re trying to communicate over these lines? Especially how do you know which of the multiple connections will send you data at a specific time?

I plan to keep an address component inside the message structure . The address will be unique to each member on the bus. This will help me to differentiate between messages coming from different units. Also , the data sending mechanism is such that it is never possible for more than two machines to be sending simultaneously. So , I could allot time slots to each address and it can transmit only when its turn comes , no blocking each other (Nick Gammon's model). Thanks for your help.

Why do you need address components in the protocol if you have multiple bus lines? I thought that you need multiple bus lines. If you use just one bus, throw away that crippled SoftwareSerial and use the hardware serial interface.

I think , you got me wrong. Let me explain what I am trying to do. My master arduino is in sleep idle mode with everything disabled except the UART. I want to wake it up via a serial message sent from another arduino located close by(just a random wakeup message). I want this to generate an interrupt , so I connect the Rx pin to pin2. Thus , my pin2 is exhausted .
The RS485 comm . takes place with another arduino placed a mile away through other initialised tx/rx pins.
I was just carried away and gave you an account of another fragment of my project.

Basically , I had exhausted pin2 for the interrupt and so I wanted to know what other digital pins I could use for RS485. Sorry for my confusing reply previously!

sen_diptangshu:
My project demands multiple softwareserial ports to receive data from multiple sources. I have already used up pins 2,3,4 . What other digital pins can I use for RS485 communication?

I agree with pylon, spend a couple of extra dollars and use a Mega2560, softwareSerial() will cause you headaches. When it sends a byte, it has to count timer ticks to create the bit stream. This means unlike the Serial() hardware which sends and receives data in the background, your sketch stalls until every byte is transfered.

pylon:
You do know that if you use multiple SoftwareSerial instances, only one can be listening at a time, don't you?
SoftwareSerial has several other limitations/design flaws that make it a bad choice for most purposes other than debugging. If you need several RS-485 connections use a Mega2560 which has 4 serial interfaces in hardware.

Chuck.

Basically , I had exhausted pin2 for the interrupt and so I wanted to know what other digital pins I could use for RS485. Sorry for my confusing reply previously!

SoftwareSerial can use any pin on the UNO but I still don't understand why you use SoftwareSerial and not the hardware serial interface.

The RS485 comm . takes place with another arduino placed a mile away through other initialised tx/rx pins.

I don't know what chips you use for the RS-485 hardware but the usual ones support up to 1200 meters which is less than a mile as far as I know (I'm not that good with that strange American units and there are several different miles, e.g. nautical mile, etc.).