Actually, many embedded systems use multiple microcontrollers and microprocessors. This is not about multi-core processors but several distinct processors used in one design.
Multiprocessor systems allow the distribution of computing power among different processors, and this way, overall speed may be increased, coding simplified, and modularity reached. Using multiprocessor embedded design has many benefits. One of them is modularity. Imagine a situation when a particular microcontroller-based subsystem needs to be installed only if a particular opinion is installed. Another, as we mentioned, is coding simplicity. Instead of writing and debugging one complex firmware, it may be broken into several distinct, easily manageable functions on different MCU’s.
Using multiple processors may reduce the overall cost of design. Imagine if the machine has to handle high-speed interrupts with a fast response, but also it has to handle message level interrupts that occur less often. For one microcontroller system, you may choose a fast and, of course, expensive MCU. While two cheaper and slower MCU’s may do the same with less horsepower.
Lets take an example of three multiprocessor embedded design:
The system consists of three CPUs: CPU1 handles keyboard and display operations; CPU2 is used to communicate between CPU1 and CPU2 and is connected to other higher-level host systems. CPU3 controls real-time motors and reads sensors. Each CPU have their own Ram and Flash and I/O. Now we can see the benefits of such a system.
Modularity – CPU2 doesn’t know what type of display (LCD, CRT) is used or what keyboard is used. CPU1 performs control of the keyboard and display. There can be connected to any subsystem with different display types and CPU1. CPU2 only sends/receives messages to/from CPU1. Same situation with CPU3 subsystem. CPU2 doesn’t care how the motor position was detected, or it just gets position data from CPU3 and sends commands. CPU3 subsystem may vary (different motor types, different sensors) without a major effect on the overall system. Messages between CPU’s may be transferred via RS232, Ethernet, direct (SPI, I2C, 1-Wire).
How to decide how many CPUs are needed? There are three main considerations:
- Independence and modularity of software;
- Processor throughput;
- Physical location.
Talking about independence, we can think like one processor can handle a stepper motor and read feedback from the positioning sensor. Another processor may handle keyboard reading and information output to display or sometimes maybe separate CPUs needed. It depends on the complexity of I/O devices. Or even CPU1 could handle the CPU2 job. If the system has optional configurations, it is better to use a separate processor for different options.