0
\$\begingroup\$

I need to create a mini wired network of MCUs. I already have custom application layer protocol and need to send messages of this format between MCUs.

My requirements are:

  1. Up to 20 units in the network.
  2. Distance between nodes up to 20m (ideally) or up to 5m (ok).
  3. Typical message size is several KB per packet, several packets per second.
  4. Message loss is not critical.
  5. Connection topology should be (best to worst): bus, line, ring or star.
  6. (Nice to have) Simple wiring. Non-tech users will plug MCUs together.

I'd like to use some standard (drop-in) solution, but I haven't found anything suitable. What I've considered:

  1. CAN, Modbus, Profibus - data frames are small << 10KB. Will have to cut messgaes into lots of small parts, and then glue them together.
  2. RS-485 bus or RS-422 links between individual MCUs. Seems OK, but will have to solve message routing problem. Or implement bus arbitration for RS-485.
  3. UDP/TCP - seems like an overkill.
  4. Current loop as a physical layer (have no idea if it is better than RS-485/RS-422).

Have I missed a good candidate? Or maybe my considerations are wrong?

\$\endgroup\$
3
  • \$\begingroup\$ You basically rejected RS-485 because it's not a unicorn. Is it really so troublesome to just wait until the bus is quiet for some amount of time before transmitting and making sure what you send on the bus is actually what is on the bus to detect a collision? And if so, just stop transmitting, have everyone wait some random amount of time and then being listening for a quiet bus again. \$\endgroup\$
    – DKNguyen
    Commented Sep 15, 2022 at 3:41
  • \$\begingroup\$ There’s wireless solutions that would probably be cheaper - esp32 for wifi and bluetooth. There’s also a point to point protocol that I’ve not used for these devices that might suit. Then you’re left with the issue of pairing/addressing which you’d have to resolve in most other of the solutions anyway. \$\endgroup\$
    – Kartman
    Commented Sep 15, 2022 at 7:06
  • \$\begingroup\$ @DKNguyen, I haven't rejected RS-485, but bus arbitration does't sound easy to me. My instinct says there will be lots of implementation details. The solution is intended to work for years without oversight. There will be multiple copies with slightly different configurations. Bugfixing will be costly. That's why I'd like to stick with well supported standard solition. Maybe there is a well known arbitration protocol available (over RS-485)? \$\endgroup\$ Commented Sep 15, 2022 at 19:17

1 Answer 1

2
\$\begingroup\$

Well, why not Ethernet? Then you have all your electrical and protocol problems solved (and then some, including galvanic isolation of your nodes), have plenty of aggregate throughput, and don't care much about topology (ok, you got me there - it's star).

If you say, 'but I'm using xx CPU that doesn't have Ethernet' I counter that you have an XY problem. Ethernet-capable MCUs are not that expensive, and you can even get SPI-interfaced Ethernet controllers if you insist on one that doesn't have it. Bonus: Power over Ethernet solves yet another issue for your trouble.

There is a new standard emerging called Two Wire Ethernet. More here: https://www.ethernet-apl.org/

\$\endgroup\$
1
  • \$\begingroup\$ My first instinct as well. The recurring cost may be higher than some other solutions, but unless you are building a lot of these systems, the savings in design cost will outweight it. \$\endgroup\$
    – Mattman944
    Commented Sep 15, 2022 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.