full duplex comunication with rs485

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to make a communication MASTER (atmega2560) - SLAVE (ATMEGA32) using RS485 full duplex.

I want the MASTER to send a data of 8 bytes, on the SLAVE , i need use bascom-avr

Can anyone help me with some sample code ?

Thanks in advance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
using RS485 full duplex
If you are using 2 chips only and full duplex then there is NO DIFFERENCE to RS232, so use the standard BASCOM com stuff.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just get it to work with RS232, then get a couple of those RS232 to RS485 port powered dongles from B&B electronics.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
get a couple of those RS232 to RS485 port powered dongles
Why? There is only 2 AVRs involved :)
Quote:
MASTER (atmega2560) - SLAVE (ATMEGA32)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can't do full duplex with RS-485

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

True, so we need to invent another name like 4 wire RS485 (or even RS422??) :)

So 1 x RS485 link going master to slave with TX permanently on in the master and RX permanently on in the slave.
Another 1 x RS485 link going slave to master with TX permanently on in the slave and RX permanently on in the master.

We now have a "Clayton" RS485 link where you have RS485 when you really don't. So confusing.. :wink:

The advantage over RS232 is that the above set up can go up to 4000ft or about 1.3Km instead of the usual 15m or so for RS232.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
You can't do full duplex with RS-485

Why? Wikipedia disagree.
http://en.wikipedia.org/wiki/Rs485

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
You can't do full duplex with RS-485
:?:

I was thinking this could be done. Why can it not be done?
If using a four conductor cable (w/ GND of course) and the proper RS-485 chips.
I have not done that, but looking at some documents (Jan Axelson) discusses this at length in her book "Serial Port Complete Second Edition".

I'll believe corporations
are people when Texas executes one.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From that Wiki page

Quote:
EIA-485, like EIA-422 can be made full-duplex by using four wires

Of course RS485 can be full duplex.

_______
Rob

Scattered showers my arse -- Noah, 2348BC.
Rob Gray, old fart, nature photographer, embedded hardware/software designer, and serial motorhome builder, www.robgray.com