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

Parents
  • 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

Reply
  • 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

Children