0
\$\begingroup\$

I want to make a project where it is necessary to communicate between several microcontrollers in the fastest way possible.

For that matter I have 10 micro-controllers whose names will be 1 ... 10:

I want 1 to receive a number as input (input from user), and send it to 2.
2 will receive the number and will add 10 to it, and send the results to 3.
And so each will add a number and send the results to the next micro-controller until it reaches 10.

10 will output the final output (the output should be the number 1 received as input + all the numbers that the other processors in the chain added).

I am looking to buy STM32F103C8 (blue pill) because they look both cheaper and also stronger (and they looked more supported) than Arduino (although I am open to suggestions for other micro-controllers including claims in favor of Arduino).

Now my question is how I connect the micro-controllers I have selected (or the suggested micro controllers) to each other in the fastest and most efficient way.

I'm not looking for suggestions like: add an Ethernet/Bluetooth module and communicate with it between the micro-controllers.

I'm looking for an explanation of how to connect them using a serial or I2C connection or something like that (and I would be happy if you could add a detailed guide on how exactly to do it, which legs to attach to etc., since I'm still relatively new at working with micro-controllers)

Thank you.

\$\endgroup\$
  • 5
    \$\begingroup\$ "The fastest possible" is not a useful spec. Something like "at least 1 Mbps and less than 100 us latency" would be a useful spec. If you insist on sticking with "the fastest possible", then "add a 400-gigabit ethernet controller" (and use a much more powerful processor than an STM32) is in fact a much better answer than serial or I2C. \$\endgroup\$ – The Photon Aug 20 '18 at 17:52
  • 4
    \$\begingroup\$ "How to" is way too broad. You named few of possibilities, now you should take some time to research about these. \$\endgroup\$ – Eugene Sh. Aug 20 '18 at 17:52
  • \$\begingroup\$ Are the chips on the same board, or is there distance? \$\endgroup\$ – Jeroen3 Aug 20 '18 at 17:55
  • \$\begingroup\$ Jeroen3 They come as separate seafarers, but as far as I'm concerned, they can be tight or even on the same board (but I assume that in order to incorporate them on the same board I will have to start making extensive changes. I prefer to leave them as they are at the moment and just attach them physically (which will be really close to each other)) \$\endgroup\$ – dog scotter Aug 20 '18 at 18:01
  • 1
    \$\begingroup\$ Look at multidrop RS-485 configurations. \$\endgroup\$ – Eugene Sh. Aug 20 '18 at 18:16
1
\$\begingroup\$

The best way depends on exactly how much data do this microcontrollers have to communicate among them, the distances the signals have to travel, the place where this communication will take place, the amount of pins/wires you're willing to use to wire everything up, the cost of the system as regards your programming time and the hardware cost. For instance CAN bus allows for communication in noisy/industrial/automotive environments but is hard to implement and can't transfer data as fast as usb 3.0 does.

If I were you, and didn't have any stringent requirements for protocol implementation, I would consider the points I mentioned and end up with the easiest option as long as community support and hardware is concerned. Search for an easy to follow and comprehensive tutorial of a protocol readily available on the boards you're considering. Each protocol has it's pros and cons so it's not as if you would be better off learning how to implement one in particular.

As regards selecting one microcontroller, you seem to be looking for a readily assembled board. There's a huge selection to chose from, and many times the right board selection boils down to other capabilities than just having a communication protocol hardware built-in. The blue-pill board you're mentioning seems to be kind of the Arduino Due "equivalent" in terms of specs, check which board suits your needs best.

\$\endgroup\$
  • \$\begingroup\$ On what board do you recommend assuming that all I need from the board is easy communication between the micro-controllers, the ability to calculate data at 1 megabits per second, and support / forums / sources of information on the board? \$\endgroup\$ – dog scotter Aug 20 '18 at 18:25
  • \$\begingroup\$ So, the capabilities of data processing are hard to quantify. Yet the Arduino Due is based on the ATSAM3X8E that whilst having the same core architecture than the STM32F103C8, runs faster at 84 MHz, so you would be able to execute more instructions per second. It also has more Flash memory, RAM and peripherals to play with. You could perhaps start by getting only one board and trying to simulate the data processing you would be doing. Even if the board turns out not to serve it's purpose it has plenty of functionality for future projects. I also believe that it has a bigger community around. \$\endgroup\$ – Juan Manuel López Manzano Aug 20 '18 at 20:01
  • \$\begingroup\$ You could also try to figure what your exact requirements are, which would be the professional way of selecting components. But I believe the hands on experience of getting any board to fiddle around with is probably the best thing to do to grasp what all the MCU specifications mean and how do they translate into practice. \$\endgroup\$ – Juan Manuel López Manzano Aug 20 '18 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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