# How to choose the right MCU and power supply to make your embedded circuit design more efficient

1, the choice of MCU

When selecting an MCU, consider the functions that the MCU can perform, the price of the MCU, power consumption, supply voltage, I/O port level, number of pins, and package of the MCU. The power consumption of the MCU can be found in its electrical performance parameters. The supply voltage is available in 5V, 3.3V and 1.8V ultra-low voltage supply modes. In order to properly allocate the I/O resources of the MCU, a pin assignment table can be drawn for MCU selection for later design.

2, power supply

(1) Consider the system's power requirements. For example, the system needs several power sources, such as 24V, 12V, 5V or 3.3V. It is estimated how much power or maximum current (mA) is required. When calculating the total power of the power supply, a certain margin should be considered, which can be calculated according to the formula "total power of the power supply = 2 × total power of the device".

(2) Consider the need for power supply volatility between chips and devices. Power supply fluctuations are generally allowed to be within ±5%. The reference voltage for the A/D converter chip is typically required to be within ±1%.

(3) Consider whether the working power supply uses a power module or an external power supply.

3, ordinary I / O mouth

(1) Pull-up and pull-down resistors: Consider internal or external up/down resistors. The internal pull-up/down-down resistance is generally around 700Ω. Low-power mode should not be used. External up/down resistors can be selected from 10KΩ to 1MΩ as needed.

(2) Switching input: Make sure that the high and low voltages are clear. Ideally, the high level is the power supply voltage and the low level is the ground level. If the external circuit cannot correctly distinguish between high and low levels, but there is still a large differential pressure between high and low, consider designing the processing by A/D acquisition. For the sampling point in the voltage division mode, the selection of the voltage dividing resistor should be considered, so that the current passing through the sampling port is not less than the sampling minimum input current, otherwise the sampling cannot be performed.

(3) Switching output: The basic principle is to ensure that the output high level is close to the power supply voltage, and the low level is close to the ground level. The sink current of the I/O port is generally greater than the discharge current. For low power components, it is best to use low level control. Under normal circumstances, if the load requirement is less than 10mA, it can be directly controlled by the chip pin; when the current is 10~100mA, it can be controlled by triode, and when it is 100mA~1A, it can be controlled by IC; the larger current is suitable for relay control, and it is recommended to use Photoelectric isolation chip.

4, A / D circuit and D / A circuit

(1) A/D circuit: It is necessary to understand the basic principle of front-end sampling, and adopt different acquisition circuits for the resistance type, current type and voltage type sensors. If the acquired signal is weak, consider how to perform signal amplification.

(2) D/A circuit: Consider which output circuit of the MCU's pin controls the actual object.

5, the control circuit

The external control circuit should pay attention to the redundancy and back measurement of the design, and should have appropriate signal isolation measures. When evaluating the layout of the design, it is necessary to take the detection hole at the input and output of the component to facilitate the measurement when the error is checked.

6, consider low power consumption

Low-power design is not just about saving power. The added benefit is that it reduces the cost of power modules and cooling systems. The reduction in current also reduces the interference of electromagnetic radiation and thermal noise. As the temperature of the device decreases, the device life is extended accordingly. To achieve low power consumption, you should pay attention to the following points:

(1) Not all bus signals are pulled up. The pull-up resistor also has power consumption issues to consider. The pull-down resistor pulls a simple input signal, and the current is below tens of microamps. But pulling a signal that is driven will have a current of milliamperes. Therefore, it is necessary to consider the effect of the pull-down resistor on the total power consumption of the system.

(2) Do not use the I/O port that is not used. If it is left floating, it may become an input signal of repeated oscillation due to a little interference from the outside, and the power consumption of the MOS device basically depends on the number of times the gate circuit is flipped.

(3) The power consumption of some peripheral chiplets also needs to be considered. It is difficult to determine the power consumption of a chip that is not too complicated internally. It is mainly determined by the current on the pin. For example, some chip pins consume less than 1 mA when there is no load, but after the load increases, the power consumption may be large.

7, consider low cost

(1) Correctly select the resistance value and capacitance value. For example, a pull-up resistor can use a 4.5K-5.3K resistor. You think you need to choose an integer of 5K. In fact, there is no 5K resistance on the market, the closest is 4.99K (accuracy 1%), followed by 5.1. K (accuracy 5%), the cost is 4 times and 2 times higher than the 4.7K with 20% accuracy. The resistance of 20% precision is only 1.1.5, 2.2, 3.3, 4.7, 6.8 (including integer multiples of 10); similarly, 20% precision capacitors only have the above values, if other ones are selected Values ​​must use higher precision, and the cost can be multiplied several times without any benefit.

(2) Selection of indicator lights. What color is the indicator on the panel? Some people choose by color, for example, if they like blue, they choose blue. However, other colors such as red, green, yellow and orange, regardless of size (5mm or less), have matured for decades, and the price is generally less than 5 cents, while blue was invented in the past three or four years. Both the degree of stability and supply stability are poor, and the price is four or five times more expensive. (Note: This is already a few years ago.)

(3) Don't choose the best. In a high-speed system, not every part works at a high speed, and for every level of device speed, the price is almost doubled, and it also has a significant negative impact on signal integrity issues.