1. Overview of embedded hardware circuit design
With the development of Internet of Things and artificial intelligence technology, our life is becoming more and more intelligent and informative. Smart phones, smart bracelets, smart locks, smart refrigerators, autonomous driving, robots and other smart products are emerging one after another, and human beings are about to enter the intelligent era. Our products and equipment should be intelligent, among which the core technology and embedded technology are used.
Embedded technology is a discipline that combines software and hardware, including embedded software and embedded hardware, which constitute the core part of intelligent products. Embedded hardware is equivalent to the shell of products, which works by embedded software, completes the corresponding functions of products under the control of embedded software, and is the carrier of embedded software. Embedded software is equivalent to the brain and soul of a product. Without embedded software, hardware is a pile of scrap metal and cannot work. Similarly, without embedded hardware, embedded software will be independent. Therefore, embedded hardware and software are equally important, and they complement each other and are indispensable.
With the development of integrated circuits, the functional design of embedded hardware is relatively simple. In most cases, it only needs to be designed according to the reference circuit provided by chip manufacturers. The core of embedded hardware design is more and more inclined to reliability design, electromagnetic radiation and electromagnetic compatibility design. Next, I will take the circuit diagram of Bluetooth module development board as an example to explain the matters needing attention in embedded hardware circuit design.
Second, bluetooth technology and bluetooth chip CC2640
“Bluetooth” technology belongs to a short-distance, low-cost and low-power wireless connection technology, and it is an open scheme that can realize wireless transmission of voice and data. It adopts ISM (industrial, scientific and medical) frequency band of 2.4GHz, with the highest transmission rate of 1Mb/s per second, and carries out full-duplex communication by time division. The general effective communication range of Bluetooth transceiver is 10 meters, and the communication distance can reach about 100 meters with power amplifier. As the head of Ericsson Bluetooth Group said, the original idea of designing Bluetooth was to “end the cable nightmare”.
CC2640 device is a wireless microcontroller (MCU), which is mainly suitable for Bluetooth? Low power consumption applications. This device belongs to SimpleLink? Cost-effective ultra-low power 2.4GHz RF devices in CC26xx series. It has extremely low active RF and MCU currents and low power consumption, which can ensure excellent battery life, and is suitable for small button cell power supply and energy collection applications.
CC2640 contains a Cortex-M3 core, which operates at 48MHZ,128K Flash,28K SRAM ,4 timers, 15 GPIO, serial port, I2C, 12-bit ADC and other common peripherals. The hardware resources are very rich, which fully meet the daily wireless applications.
Third, the Bluetooth chip CC2640 hardware circuit design considerations
The design of hardware circuit of embedded system based on MCU needs comprehensive consideration according to demand analysis, and there are many problems that need to be considered. Here are some special issues that should be paid attention to.
1. MCU selection
When selecting an MCU, we should consider the functions that the MCU can perform, the price, power consumption, power supply voltage, I/O port level, pin number and package of the MCU. The power consumption of MCU can be found from its electrical performance parameters. There are 5V, 3.3V and 1.8V ultra-low voltage power supply modes. In order to allocate the I/O resources of MCU reasonably, a pin allocation table can be drawn during MCU selection for future design. The wireless bluetooth module using CC2640 CPU is selected here.
Circuit schematic diagram of CC2640 bluetooth wireless module is as follows:
XDS110 debugging interface
2. Design of power supply circuit
(1) Consider the power demand of the system, for example, the system needs several power supplies, such as 24V, 12V, 5V or 3.3V, etc., and estimate how much power or maximum current (mA) each needs. A certain margin should be considered when calculating the total power of the power supply, which can be calculated according to the formula “total power of the power supply =2× total power of the device”.
(2) Consider the demand of chips and devices for power supply fluctuation. Generally, the fluctuation range of power supply is allowed to be within 5%. The reference voltage of A/D conversion chip is generally required to be within 1%.
(3) Consider whether the working power supply uses a power module or an external power supply.
Here, we use low dropout, low noise, ultra-fast linear regulator RT9013 to power Bluetooth wireless module.
The transmission working current of CC2640 is about 10 mA, and the output current of RT9013 can reach 500mA, which completely meets the requirements of CC2640 for working power supply. The circuit design is as follows:
3. Design of common IO port circuit
(1) Pull-up and pull-down resistors: internal or external pull-up and pull-down resistors are considered, and the internal pull-down resistance is generally around 700Ω, so the low power consumption mode is not suitable. External/pull-down resistors can be selected from 10kω to 1mω as required.
(2) Switch input: Make sure that the high and low voltages are distinct. Ideally, the high level is the power supply voltage, and the low level is the ground level. If the external circuit can’t distinguish the high level from the low level correctly, but there is still a large voltage difference between the high level and the low level, the A/D acquisition method can be considered for design and processing. For the sampling point in the voltage dividing mode, the choice of voltage dividing resistor should be considered, so that the current at this point through the sampling port is not less than the sampling minimum input current, otherwise the sampling cannot be carried out.
(3) Switch output: the basic principle is to ensure that the high level of output is close to the power supply voltage and the low level is close to the ground level. The absorbed current of I/O port is generally greater than the discharged current. Low-level control is the best way to control low-power components. Generally, 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 the current is 100 ma ~ 1 a, it can be controlled by IC. Higher current is suitable for relay control, and photoelectric isolation chip is recommended.
Here, all I/O ports of the development board are led out, which is convenient for users to carry out secondary development and test verification. As shown in the figure below:
4. A/D circuit and D/A circuit
(1)A/D circuit: It is necessary to know the basic principle of front-end sampling, and adopt different acquisition circuits for resistance type, current type and voltage type sensors. If the collected signal is weak, we should also consider how to amplify the signal.
(2)D/A circuit: Consider which output circuit the MCU pins control the actual object.
5. Control circuit
For external control circuit, attention should be paid to design redundancy and back test, and appropriate signal isolation measures should be taken. When evaluating the layout of the design, the inspection holes must be led out at the input and output ends of the components, so as to facilitate the measurement when troubleshooting errors.
6. Consider low power consumption
Low-power design is not only for saving electricity, but also for reducing the cost of power module and cooling system. The interference of electromagnetic radiation and thermal noise is also reduced due to the reduction of current. As the temperature of the equipment decreases, the service life of the device is correspondingly prolonged. To achieve low power consumption, the following points should be paid attention to:
(1) Not all bus signals have to be pulled up. The pull-up and pull-down resistors also have power consumption to consider. The pull-down resistor pulls a simple input signal, and the current is below tens of microamperes. But when a driven signal is pulled, its current will reach milliamp level. Therefore, it is necessary to consider the influence of pull-up and pull-down resistors on the total power consumption of the system.
(2) The unused I/O port should not be hung up. If it is hung up, it may become an input signal that oscillates repeatedly due to a little interference from the outside, and the power consumption of MOS devices basically depends on the flip times of gate circuits.
(3) The power consumption of some peripheral chips should also be considered. It is difficult to determine the power consumption of a chip with less complicated internal components, which is mainly determined by the current on the pins. For example, some chip pins consume less than 1 mA when there is no load, but when the load increases, it may consume a lot of power.
7. Consider low cost
(1) Correct selection of resistance value and capacitance value. For example, a pull-up resistor can use a resistor of 4.5K-5.3K If you think, choose an integer 5K. In fact, there is no 5K resistance in the market. The closest one is 4.99K (accuracy 1%), followed by 5.1K (accuracy 5%). Its cost is 4 times and 2 times higher than that of 4.7K with accuracy of 20%, respectively. The resistance values of 20% precision resistors are only 1, 1.5, 2.2, 3.3, 4.7 and 6.8 (including integer multiples of 10); Similarly, capacitors with 20% accuracy only have the above values. If other values are selected, higher accuracy must be used, and the cost will be doubled several times, but it will not bring any benefits.
(2) Don’t choose the best for everything. In a high-speed system, not every part works in a high-speed state, and every time the device speed increases by one level, the price will almost double, which will also bring great negative impact on signal integrity.
As an embedded engineer, we should know not only the design of embedded software but also the hardware design, at least the hardware schematic diagram and the working principle of hardware, so that we can better write efficient embedded software, debug products and solve equipment failures, and then analyze and solve problems from the perspective of software and hardware. That’s what I want to share with you this time about the design of embedded hardware. I hope it will be helpful to the students.