This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Rs485

Hello,

Maybe this is not a question for this forum, but I still give it a try:

I would like to have different 8051's (or derivatives) "talking to each other" via a serial protocol. One uC would be a 'master'. The other ones should trigger the master when some info (decoded RC5-signal) is available.

Since the different devices will be put quite far from each other (several meters, up to maybe 25 meters each), I think the RS232 protocol is not suitable anymore for this (distance too long).

Therefore, I was thinking to use RS485, but I have to be honest: I don't know a lot of this protocol/standard.

Can someone tell me where to find useful information about this protocol? Eventually sites where some C source code for the protocol is already available to give it a start?

Does Keil have some useful example programs next to the tig amounts of other examples already available? I didn't find anything regarding RS485 myself on the site, but there might be some 'hidden places' with more useful information...

Any help would be highly appreciated.

Rgds,

--Geert

  • For what it's worth, here's what I know.

    The primary difference between RS-232/422/485 is mainly the hardware used to generate the signal on the wires that connect various devices. For RS-232, that's typically a MAX232.

    RS-232 is single-ended and does not work well over long distances.

    RS-485 is differential (2 wires, + and -) and is better suited to handle noise.

    From the 8051 perspective, you still program the on-chip UART as normal.

    The big difference happens when you have multiple devices on the "bus". Then, you must handle some kind of protocol to communication between nodes. In fact, once you have more than 2 devices connected, you have created a network.

    At this point, I think there are a lot of things you should consider. Here are a few:

    1. How "automatic" do you want the communication to be?
    2. Do you want a master/slave configuration or do all nodes have equality?
    3. Where is the protocol handled (in software you write or in hardware)?
    4. How much can you spend?
    Here are some suggestions for different ways to connect multiple devices:

    • RS-232: Easy to use, great for 2 devices that are within 150 feet. Speed up to 115K Baud
    • RS485: Good for multiple senders and receives on a cable about 1 mile long. Software is used to handle protocol. Speed up to 1 MBit???
    • CAN: Protocol/collisions handled in hardware. Messages only 8-bytes long. Can go long distances. Speed up to 1 MBit.
    • USB: PC-compatible bus. 1 master. 12 MBits. Short distance (2M or less).
    • ARCNet: 8051 devices and stand-alone devices available. Up to 5 MBits. Easier than ethernet. Protocol in hardware. Messages up to 508 bytes.
    • EtherNet: Compatible with networking. TCP/IP stacks available. High-speed (100MBits).
    I'm sure I left a lot out, but hopefully, this is enough to get started.

    For more details on RS-485, use google. There are a lot of RS-232/422/423/485 web sites out there.

    Jon

  • Review the 9-Bit Serial data mode for most 80C51 family. With the ninth bit you can build a simple protocol checking the ninth bit to define an address byte. Working with a single master and multi units on a bus, the RS485 driver devices provide the support for bus loading.
    With an RS232 driver, one device turned off will block the serial bus but RS485 devices will isolate each unpowered driver.
    The older device was a sn75176 (TI) but I'm sure I have read of newer devices from Maxim/Dallas Semi about RS485 drivers chips supporting four to eight differential lines.
    WATCH the pull up value ranges as devices are added or removed from the seral bus. Bradford

  • Geert;
    Drivers should have read Transceivers. See
    http://analog.ti.com and search on SLLA070B for 422/485 Standards Overview and Configurations.

  • the very best appnotes on RS-485 are at national semiconductor, anyone taht does 485 without reading "ten ways to bulletproof RS-485" is missing very valuable info.

    Erik

  • Hello guys,

    Thanks a lot for all your input. I think I have enough stuff to read and study. I'll try to go through the documents/components mentioned before and then I'll see how far my knowledge is about how to use RS-485.

    Thanks a lot!

    --Geert