03-05
2021
Design of sound and light control lamp system based on single chip microcomputerWith the rapid development of society, technology is following closely behind. Many public places have taken many measures in terms of lighting. This will also be a current development trend. In addition to sound and light control in real life, microwave induction and human body There is also an infrared sensor switch. However, microwave induction is not stable enough and anti-interference is not ideal. Although infrared induction is more ideal than microwave induction in terms of performance, because its installation is more complicated and the price is relatively expensive, the scope of application of infrared induction is limited. , can only be used in some well-managed places, such as: hotels, restaurants, corridors and some fixed corridors. Although infrared sensors can be used to control lighting in these places, there are also price issues and unfavorable factors in installation management.The circuit design avoids the above instability, performance, price and installation limitations. It can meet most of the environment and can save energy in a limited amount.1. Hardware circuit design of sound and light control lamp systemThe course design circuit is composed of 51 single-chip microcomputer, LM393 voltage comparator circuit, electret microphone control circuit, photoresistor control circuit, relay control circuit, digital tube countdown, key switch display part.1.1 MCU and display partThe circuit is composed of a single-chip microcomputer, a triode, and two common anode digital tubes. The time countdown digital tube display circuit is shown in Figure 2; when the program enters initialization, the digital tube displays ten seconds, and when there is sound at night, the digital tube starts to count down when the relay is closed. The pins of the single-chip microcomputer output high and low levels to change the base voltage of the triode, so that Q2 and Q3 are turned off or turned on, thereby changing the bit display of the digital tube. The P0 port of the microcontroller outputs high and low levels to change the values of a, b, c, d, e, f, and use human visual effects to display different numbers. The two-digit digital tube is a common anode digital tube, and the segment selection is connected to the P0 port. By changing the high and low levels of the P0 port pins, the numbers are displayed, and the P2.3 pin is used to control the one-digit digital tube on and off, and the P2.7 is used to control the ten-digit digital tube on and off, and a certain time Scan at intervals, pull up or down the pins of P0 port, P2.3, and P2.7 to display the changes of different digital tubes on and off. The driving current of the single-chip microcomputer is limited, and it cannot drive the digital tube to light at the same time, so two PNP transistors Q2 and Q3 are added to drive the digital tube to display.Press the button S2 to pause the display and the light is always on, press the digital tube again to continue the countdown.1.2 Sound and light partFigure 3 shows the sound and light control circuit. By changing the resistance value of the photoresistor RRR, the voltage of the same input terminal INA+ is changed, and at the same time compared with the voltage of the reverse input terminal INA-, the resistance value of the photoresistor RRR is changed by the intensity of the external light, and the external light When it is strong, the resistance value of RRR is only a few hundred ohms, and when the external light is weak, the resistance value of RRR is tens of megohms. The photoresistor RRR and R5 resistor are connected in series in the circuit, and the change of RRR resistance causes the change of INA+ pin voltage. The INA+ pin voltage is lower than the INA- pin voltage and OUTA outputs a low level. At this time, the photoresistor works at night. The INA- pin voltage can be adjusted by the sliding rheostat R4.The electret microphone MK1 converts the sound into a weak voltage signal. When there is a sound, the microphone senses the sound and generates an AC signal, and then the AC signal causes a voltage drop across the voltage across C4, forcing C4 to charge. At this time, the base of the triode has a voltage, which meets the conduction condition of the triode. At this time, the collector pin becomes a high level. After the voltage of INB- is compared with the voltage of INB+, OUTB outputs a low level, and the conduction time of the triode depends on the capacity of capacitor C4.1.3 Relay partThe pin P3.7 of the microcontroller is connected to the base of the transistor Q1, and the transistor is used to turn on and off the relay, which becomes a relay drive circuit as shown in Figure 4: the base of the transistor Q1 is connected to P3 of the microcontroller. 7 ports, the output current of the I/O port of the microcontroller is about 20mA, so it cannot be directly used to drive the load. Q1 is used to amplify the current, the amplified current is ninety times, the rated current of the relay is 40mA, and the base current of Q1 is amplified enough to drive the relay to work. When the P3.7 port outputs a high level, the Q1 transistor is cut off, and when the P3.7 port outputs a low level, the Q1 transistor is turned on, the relay is energized, the relay is normally open, the electric shock is closed, and the load light is on.The LED is used to display the pull-in and disconnection state of the relay. When the relay is pull-in, the LED light is on, and when the relay is disconnected, the LED light is off.2. Installation of sound and light control lighting systemFirst draw the schematic diagram and check, compile the program, draw the simulation circuit and debug it, the software can be realized, and then prepare the materials needed for welding, as well as various tools, first test whether each device is good or not, and can correctly distinguish each device Positive and negative electrodes, how to use them, what to pay attention to when welding, the sequence of the welding process, one part is debugged after welding, the other part is inspected after welding, and problems can be solved if you know how to modify the program.3. Comprehensive inspection of sound and light control light systemBefore welding the circuit, it is necessary to measure each component separately to see if there are any bad components, to find out the positive and negative poles of each component and its function, and the order of welding. If some components have sockets, solder the sockets first, and insert the components into the sockets after soldering the sockets. When soldering electrolytic capacitors, digital tubes and LED lights, the temperature of the soldering iron should not be too high, and the soldering time should not be too long, so as not to burn out the components.After the circuit is soldered, it is necessary to check each pin to see if there is any false soldering or missing soldering on each pin, and use a multimeter to check whether the positive and negative electrodes of each component are connected together. Whether each pin is short-circuited, and whether some pins are supposed to be connected together are not soldered or soldered incorrectly. In particular, the pins of the single-chip microcomputer are too close, and a multimeter should be used to check whether the adjacent pins are short-circuited. Check whether the connection of each pin is correct, and whether the functions of the pins are wrongly soldered. After checking the basic measurements, don't rush to power on, insert the components into the socket, and then use a multimeter to measure each pin to see if there is any short circuit, open circuit, or false soldering. Finally, be sure to measure the positive and negative poles of the circuit to see if there is a short circuit.in conclusionThis course is designed for energy saving, using the combination of single chip microcomputer, sound and light to realize lighting. The research in this paper is suitable for use in homes, offices, corridors, buildings, and some public places as street lights. Its working principle uses the sound of people walking to be detected by the circuit, and at the same time it is determined that the light will be on at night, and the light will be turned off after a delay after the person leaves. Even if someone passes by during the day, the light will not turn on, and the power consumption of the circuit itself is low. It is powered by a five-volt power supply, and coupled with the characteristics of the circuit itself, this circuit has the effect of saving energy. The design has a wide range of use and is stable and reliable, and it is worthy of being applied to life.This course designs sound and photosensitive circuits to adjust their sensitivity, adds buttons to keep the lights on, and increases the display time of the lights to improve its practicability. When someone passes by continuously, it will re-update the countdown with the last person as the countdown, so that the design is more in line with the actual situation.The above is the design method of the sound and light control light system based on the single-chip microcomputer introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things module. We have hardware design and software development capabilities. Covering circuit design, PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development, voice recognition technology, Bluetooth development, wifi technology, etc. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the development of electronic education products.
03-04
2021
Design and analysis of intelligent meter reading system based on single chip computerWith the continuous development of science and technology, people's life is increasingly inseparable from the support of electricity. In the current information age, people's production, life, study and other aspects are closely related to electricity. Therefore, people's electricity consumption is gradually increasing, which puts forward higher requirements for meter reading work. Traditional meter reading work cannot meet the current needs, so power companies must vigorously develop intelligent meter reading systems.1.The hardware design of the meter reading system1.1 Overall architecture designIn order to make the meter reading system more intelligent, it is necessary to add functions such as pulse counting, data storage and processing, display of power and status, and control of the communication center. First, the power collection technology module will calculate the data of the electric meter according to the pulse count, and store the data in the RAM inside the system. Secondly, the system kernel will send the data transmission order to the pulse technology module on time according to the set time, so that it can collect the data of the electric meter, and store the data in RAM according to the agreement set in advance, and then wait for the host computer Inquire, and record the number of the host computer that responds slowly and feed it back to the host computer. Finally, the upper computer has two operation modes, one is timing copying, and the other is copying at any time. Timing copying means that the host will query the data collected by each pulse technology module according to the time set by the system; while copying at any time means reviewing the data of a user separately under special circumstances. It is worth noting that in these two modes, it is necessary to back up the unresponsive computer data and give a warning.1.2 Each module designThe design of each module of the system is the core point of the intelligent meter reading system, mainly including backup power supply, power collection module, communication module, clock module, display module, etc. The selection and design of each module is related to the operation of the entire meter reading system efficiency and quality.First, the circuit design of electric energy data acquisition. There are two design schemes for the test module of the electric energy meter. One is to use discrete components PT, CT, S/H, FIR and multiplier to calculate voltage, current and power. The second is based on the principle of digital multiplier, according to its proprietary large-scale integrated electric energy metering chip to sample voltage and current, etc., and output active power through pulses, which is convenient for microprocessors to process, and it is more convenient to use , reliable performance and high calculation accuracy.Second, the design of the decoding circuit. The decoding circuit can use the 74LS138 chip, and decode through the I/O line of P2.5-2.7, select a reasonable chip according to the time, and transmit its power signal to the single-chip microcomputer. In addition, when it is designed, many slices of parallel sampling circuit chips, memory chips and field bus chips are also used. These chips can be shared by the I/O port of the single-chip microcomputer, and they can be used as data or address lines, and the gate of these chips can be realized with the support of the decoder circuit, so as to avoid conflicts between the addresses of the data lines.Third, the choice of CPU, as the core of the intelligent meter reading system, the CPU will directly affect the operation of the system. Therefore, for the CPU, it can be compatible with the instruction system, can be repeatedly erased and written more than 1000 times, has multiple bidirectional I/O ports, the clock frequency should be kept at 0-33MHZ, and there must be two 16-bit programmable The timer or counter also has a dual-duplex serial interrupt port line, a power-saving mode for interrupt wake-up, a watchdog circuit, and a software idle function.Fourth, watchdog and peripheral storage design. Most single-chip microcomputers must have a reset circuit, which requires that the reset circuit can be reliably reset when the single-chip microcomputer is powered on, and can keep the program in order when the power is turned off, so as to ensure that the data stored inside will not be tampered with. In addition, the single-chip microcomputer will be disturbed by various factors during operation, and even crash. In order to solve this problem, a watchdog circuit can be added. When there is a problem with the operation of the single-chip microcomputer, it can provide a reset signal for the single-chip microcomputer in a short time to reset the system. In addition, in order to avoid the data loss of the single-chip microcomputer in the case of a sudden power failure, peripheral storage design should be carried out, and an unprocessed monitoring chip should be installed. When a power failure occurs, the single-chip microcomputer can be notified in advance to store data.Fifth, the design of the clock module. Because the intelligent meter reading system is an automatic measurement and control system, it not only needs to record data, but also stores the time of recording data. When abnormal data occurs, the source of the problem can be found according to the data recording time. In order to realize automatic meter reading and record the meter reading time at the same time, a clock chip can be used for timing processing. After setting the meter reading time, the intelligent meter reading system will check the meter data according to the time set by the chip.Sixth, the design of the display module and power circuit. Display module can use PS7219 static display chip. Because it has a function control register of 15*8RAM, it is convenient to select an address, and can control and refresh each digit individually without rewriting. And the numbers can also control the brightness of the displayed numbers, and each number can flash. For the circuit, it can be divided into two parts for power supply, one is to supply power to the digital chip of the circuit, and the other is to supply power to the bus circuit, and the power supply voltage of the two is controlled at +5V. In order to ensure that the collector can continue to work when the power grid is suddenly cut off, a backup power supply must be designed. 6V, 4A batteries can be selected, and the control circuit of the backup power supply is composed of two parts: backup power switching and power charging. When there is a sudden power failure, the power supply can be automatically switched to the backup power supply to ensure the normal operation of the microcontroller.2.The design of the communication part of the meter reading system2.1 The way of communicationThe CPU of the computer has two ways to exchange information with the outside world, one is parallel communication, and the other is serial communication. Parallel communication means that data can be transmitted at the same time, which has the characteristics of fast transmission speed and high efficiency, but the number of transmission lines is controlled by the number of transmission data bits, so the design cost is relatively high. In addition, the parallel transmission distance generally does not exceed 30m. Serial communication refers to the transmission according to the order of data, which has the characteristics of fewer transmission lines, low cost, low efficiency and slow transmission speed, but its transmission distance ranges from a few meters to thousands of kilometers. For the intelligent meter reading system, because the distance between the measurement and control object and the measurement and control center is uncertain, the serial communication method will be used.According to the boundary of the data stream, its timing is inconsistent with the synchronous mode, so the serial communication can be divided into two modes: synchronous serial and asynchronous serial. Among them, the synchronous serial communication method uses data blocks as information units for data transmission, and each frame of information contains a large number of characters, and the amount of information transmission is relatively large. The asynchronous serial communication method refers to the data transmission of characters as information units, and the amount of information transmitted each time is small, and each frame of information only contains one character. It can be seen that asynchronous serial communication will be used in occasions where the amount of data transmission is small and the transmission efficiency is low. For the intelligent meter reading system, asynchronous serial communication should be used. When designing its communication interface, it is necessary to choose the interface reasonably according to the actual situation, and at the same time, it must also consider multiple issues such as transmission media, communication control chips, and level conversion, so as to ensure that the communication has high reliability. The distance, speed and anti-interference ability can all be consistent with the standard.2.2 Data uploadData upload is to transmit the meter data collected by the collector to the network device in an asynchronous serial manner, which is mainly manifested as a level conversion function. First of all, for the RS-232 bus standard, it is the serial communication bus interface with the highest utilization rate at the present stage. When connecting RS-232 to the system, the communication methods are divided into short-range and long-range, and the short-range communication is divided into three methods. One is with the hardware handshake function, and the sending and receiving of data are interconnected. Two devices can be connected at the same time. Send and receive data. Data terminal readiness and device readiness are also interconnected, which can effectively detect whether the other party is ready. The second is the handshake function between CTS and RTS. After sending a request to the other party, the other party's response will be indicated by clearing the sender. And its sending line will be connected with the detection line of the other party. The third is to cross-connect the sending and receiving of data, use the docking function together, do not use other signals, and leave it in the air, and realize the handshake function through software. In the design of the intelligent meter reading system, the two ends of the system are the network access device and the single-chip microcomputer level conversion chip, and the three wires are connected between the two, and the computer data is transmitted to the network to realize remote transmission.2.3 Data transmissionFor the data transmission module, the most suitable bus design standard is RS485. Because RS485 is a dual half-duplex, it can send and receive data at the same time. It can be used in multi-occupancy interconnection, which can effectively reduce the waste of signal lines and facilitate long-distance data transmission. And it can use public telephone lines for network communication. From the perspective of its circuit structure, terminal resistors are installed at both ends of the balanced connection, and a data transmitter, receiver or transceiver is installed in the balanced cable. In addition, it does not have data sending and receiving rules. When the transmission distance is less than 1200m, its transmission speed can reach 10KB/s. Therefore, the RS485 serial standard can be used for data transmission in the intelligent meter reading system.For the data transmission chip, the MA485 chip can be selected, because it is not only suitable for the RS485 standard, but also suitable for the RS422 standard. It has many advantages, with +5V power supply; low power consumption, the working current is 120 microamps, and the static current is 300 microamps; the driver has overload protection function; the communication transmission line can hang multiple transceivers; it is suitable for half-duplex communication.3. Software design of meter reading system3.1 Requirements for overall software designIn order to meet the requirements of the intelligent meter reading system and make it have higher quality and efficiency, the following requirements should be met when designing the software. First, it should be easy to understand and easy to maintain. Because with the improvement of production automation, the structure of the measurement and control system becomes more and more complex, the designer cannot fully understand the entire system in a short time, and the software can only have high performance after repeated design and debugging. For an intelligent meter reading system, if its module design has a clear goal and a clear idea, it will be convenient to check for errors and debug. Treat each subroutine as a building block, and arrange them in a reasonable order. Generally, there will be no errors. When a problem occurs, maintenance personnel can judge according to the phenomenon and type of the problem, so as to find the fault point and solve it. The use of modular design facilitates the expansion or modification of the system's functions. Second, it must be real-time. This feature is the basic requirement of an intelligent meter reading system. With the development of science and technology and the improvement of hardware integration, reasonable selection of software can meet this requirement. Third, it is testable. For the intelligent meter reading system, on the one hand, it is necessary to test the software according to the existing test results; It is used in real life. Fourth, accuracy and reliability. Only when the intelligent meter reading system has high accuracy and reliability can it be put into use, so as to strengthen the vital interests of users and promote the better development of my country's electric power industry.3.2 Design of the main programFor the main program design of the system, it is mainly through calling the corresponding subroutine that the electric energy pulse is collected, displayed and communicated by time, which is the main line of the meter reading system design. When the power-on reset reaches the main program, except for the initialization program and power-on data data clearing, other parts are in an infinite loop state, and all functions of the meter must be performed in the loop. If there is no system power-off or program Paralyzed by interference, this execution loops forever.3.3 Subroutine DesignIn the meter reading system, in order to avoid loss of data stored in the meter due to misoperation, a reset program should be added after the baud rate is set in the system, that is, press and hold the reset key before power on, when the display screen is cleared and After flashing, release the reset key, and the system can operate normally. The reset keys should be sorted in the order of pulse counting unit clearing, pulse unit clearing, arithmetic unit clearing, and energy storage unit clearing. For the design of receiving data and communication program, first power on, initialize the program, and then make commands to the computer, and record the number of successful acquisitions at the same time. And the main program should be in the state of waiting to receive. At this time, it is in the communication state with the PC. When the PC sends commands, the main program will be interrupted and the data collected in the data acquisition module will be obtained. When the PC command is successful, it will The reception success mark appears. For the data acquisition program, it includes multiple modules such as parameter setting, meter reading number, data storage, account number design, and meter number reset. The use of the module should be executed according to the command. In addition, the subroutines also include pulse acquisition program, display subroutine, verification subroutine and data transmission subroutine. Only by designing these subroutines well can the intelligent meter reading system run stably.4. Anti-interference design of meter reading system4.1 MCU hardware anti-jamming designFor single-chip microcomputers, there are many interference factors, some of which come from inside and some from outside. Its internal interference is determined by many aspects such as the manufacturing process, while the external interference has nothing to do with the system mechanism and is determined by external factors. Interference problems on the power supply include undervoltage, overvoltage and power failure, which require a backup battery to be added to the system. For radio frequency interference, it is necessary to reduce the electrical width of the band. For surges, sags, and large peak pulses, two isolated power supplies can be used for power supply, or absorbing elements can be installed in the power supply circuit to improve the anti-interference ability of the system.4.2 MCU software anti-jamming designDuring the operation of the intelligent meter reading system, in order to avoid the infringement of other frequency bands, traditional hardware anti-jamming measures can only prevent part of the frequency band interference. Therefore, in order to ensure that the application programs can be executed in an orderly manner according to the established order, relevant measures must be taken during the system design process to improve the reliability of the system operation, reduce the incidence of software errors, or restore the normal state by itself when the software has errors. By designing instruction redundancy, the running programs in the program area can be restored to normal; by designing software traps, the running programs that are not in the program area can be restored to normal; through Watchdog technology, some programs in an endless loop can be restored to normal. The runaway program returned to normal. Therefore, when designing an intelligent meter reading system, the above design must be included so that the system can run stably.SummarizeThe design of the intelligent meter reading system of the single-chip microcomputer includes: the hardware design of the meter reading system, the design of the communication part, the software design of the meter reading system, and the anti-interference design of the meter reading system. Only when these designs are done well can the intelligent meter reading system be able to Stable and effective operation, so as to promote the sustainable development of my country's electric power industry.The above are the design and analysis details of the intelligent meter reading system based on single-chip microcomputer introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions for Jieli, Ankai, Allwinner, Realtek, etc., and also develop BLE Bluetooth ICs, dual-mode Bluetooth modules, wifi modules, and IoT modules. We have hardware design and software development capabilities. Covering circuit design, PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development, voice recognition technology, Bluetooth development, wifi technology, etc. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the research and development of electronic education products.
03-03
2021
Research on Electromagnetic Interference Technology of SCM Application SystemThe single-chip microcomputer system is more and more widely used in industrial applications, and it is an important technical means in product development and production. However, due to the harsh electromagnetic environment in which the system is located, the single-chip microcomputer is often subject to various internal and external interferences when it is working. Work is adversely affected. In order to ensure the reliability and safety of the single-chip microcomputer system, it is necessary to understand the cause of the interference, which is an important issue to solve the interference.1. MCU system interference categories and analysis1.1 Elements of electromagnetic interference in single-chip microcomputer systemThere are three factors in the electromagnetic interference problem of the single-chip microcomputer system, namely, the electromagnetic interference source, the coupling path, and the sensitive equipment.Among them, the interference source refers to the components, equipment and signals that generate interference; the coupling path refers to the path and medium from the interference source to the sensitive equipment. The typical coupling way is the conduction through the wire and the radiation in the space; sensitive equipment refers to the disturbed object, such as single-chip microcomputer, amplifier, digital-to-analog converter, etc.1.2 Classification of electromagnetic interference of single chip microcomputerElectromagnetic interference in single-chip microcomputer systems is usually divided into several types, which are classified according to the propagation mode, the cause of noise, and the waveform characteristics. According to the propagation mode, it can be divided into series mode noise and common mode noise; 2) According to the cause, it can be divided into high frequency oscillation noise, discharge noise, surge noise; 3) Waveform characteristics can be divided into pulse voltage, continuous sine wave, pulse sequence etc.The interference source of the single-chip microcomputer system is mainly electromagnetic energy interference. Interference sources are mainly divided into internal interference sources and external interference sources:(1) The internal interference source mainly comes from the mutual interference between the printed circuit board and the circuit; mainly due to the unreasonable design of the printed circuit board inside the system, incorrect layout of components and grounding, etc., the microcontroller system cannot work normally .(2) External interference sources are mainly electromagnetic waves and electromagnetic fields. Strong electromagnetic field interference signals will affect the work of the single-chip microcomputer system. Strong external interference signals mainly enter the internal system of the single-chip microcomputer through the power supply. Therefore, the anti-interference method of the power supply is a research focus of our electromagnetic anti-interference.1.3 The influence of electromagnetic interference on the microcontroller1) The data acquisition error of the single-chip microcomputer system increases, which makes the RAM data tampered and reduces the reliability of the data.2) The single-chip microcomputer control system fails, and when the automatic control system is subjected to electromagnetic interference, misoperation and miscontrol and loss of control may occur, which reduces the effectiveness and reliability of the single-chip microcomputer control system.3) The program runs abnormally, and the interference makes the PC value of the single-chip microcomputer reach the unused address space for meaningless operation, or the program runs in the normal address space, but the interference makes the program jump to the place where it should not go or run Into an endless loop.2. Electromagnetic Interference Suppression Technology2.1 Hardware anti-jamming technologyHardware anti-interference technology is the preferred anti-interference measure in the application and design of single-chip microcomputer systems. It can effectively block the interference propagation path, suppress interference sources, and reasonably arrange and select relevant parameters. Hardware anti-interference measures can suppress most electromagnetic interference. Commonly used The hardware interference is as follows.1) Printed circuit board design. Whether the design and layout of the printed circuit board are reasonable or not is very important to the reliability of the single-chip microcomputer system. Here is a key step in the generation, propagation and absorption of noise.From the perspective of reducing radiation interference, multi-layer boards should be used as much as possible. The inner layer is used as the power layer and the ground layer respectively. Form a uniform ground plane for the signal, increase the distributed capacitance between the signal line and the ground plane, and suppress its internal force radiating to space. For multi-layer circuit boards, the ground planes in different areas must meet the 20 H rule at the edge (that is, the edge of the ground plane should be 20 H longer than the edge of the power layer or the signal line layer, and H is the ground plane and the signal layer. between heights).Power lines, ground lines, and printed circuit board traces should maintain low impedance to high-frequency signals. In the case of high frequency, power lines, ground lines or printed circuit board traces will all become small antennas for receiving and transmitting interference. Reducing this kind of interference is to reduce the high-frequency impedance of the power line, ground wire, and printed circuit board wiring itself, and the arrangement should be appropriate, as short and straight as possible. When there are different functional circuits on the circuit board, the different types of circuits should be separated, and their grounding should also be separated; no signal lines can pass through the cracks on the ground surface.An independent ground wire is used on the I/O interface to provide a clean place for the filter and shielding layer, and the filter should be as close as possible to the cable inlet and outlet. The ground wire of the high-speed clock should be as short as possible, do not change layers, and the corners should not be 90°, and keep as far away from the I/O port as possible; the heat sink installed on the chip should be connected to the signal ground; the driving circuit of the I/O interface should be close.2) Select components. Components are the foundation of the system and also an important link in the control system. Only by selecting components reasonably can the reliability and stability of the entire system be improved. Therefore, components with high integration, strong anti-interference ability, and low power consumption should be selected. electronic devices.3) Grounding technology. Signal grounds are usually divided into single-point grounding, multi-point grounding, and hybrid grounding. When the signal frequency is less than 1MHz, use single-point grounding; when the operating frequency is 1 MHz to 10 MHz, when using single-point grounding, the length of the ground wire must not exceed 1/20 of the wavelength, otherwise multi-point grounding is used; the signal operating frequency is greater than 10 MHz, multi-point grounding should be used in order to reduce ground impedance. The grounding point of the multi-level circuit should be selected at the input end of the low-level circuit, so that this end is closest to the reference position, the grounding of the input stage is shortened, and the possibility of electromagnetic interference is reduced.4) Isolation technology. Through isolation, external interference can be cut off, and at the same time play the role of restraining drift and safety protection. Generally divided into physical isolation and optical isolation. Physical isolation is generally aimed at the input signal of the front-end of the single-chip microcomputer, which is divided into two parts in industrial measurement. (1) The display and control part is called the secondary instrument; (2) the sensor is called the primary instrument. Sometimes the distance between the primary instrument and the secondary instrument is far away, and the signal is easily disturbed during the transmission process, and its signal line is much larger than the power line; photoelectric isolation is to isolate the electrical signals of the two circuit systems, and transmit the signal through the optocoupler. It can not only ensure the transmission of noisy signals from one circuit to another, but also ensure the correct transmission of signals. In DC and low-frequency systems, optoelectronic coupling is mostly used for isolation. Because light is used as a medium for indirect coupling, it has high electrical isolation and interference suppression capabilities.2.2 Software anti-jamming technologyAlthough the hardware anti-jamming technology is adopted, it is difficult to ensure that the single-chip microcomputer system will not be disturbed due to the complexity of the reasons for the interference and the large randomness, so the software anti-jamming technology is used to supplement it.1) Instruction redundancy technology. When the MCU is strongly disturbed, the value of the program counter PC will change, the program will deviate from the normal running track, there will be random flying, the value of the operation will change, and the operand will be wrongly put into the operation code. Instruction redundancy is similar to software traps, but there are differences. Software traps are used in unused areas of program memory, while instruction redundancy is usually in programs. The practice is to insert some NOP instructions after normal instructions or put valid bytes Rewriting, the use of instruction redundancy technology can not only make the runaway program regular, but also help to eliminate random interference and improve reliability.2) Software trap technology. Software trap refers to a series of instructions that can restore the runaway program to normal operation or return to the initial state. Usually, the NOP empty instruction is used as a software trap. When the program is out of control, as long as the PC points to these units, after performing several empty operations in succession, The program will execute the following normal program or be forced to jump to a specified location and automatically return to normal. When the program is working normally, the software trap will not affect the normal operation of the system.3) Digital filtering technology. Digital filtering is realized by program, and it can be shared by multiple channels without adding hardware equipment. It has high reliability and high stability, and can filter low-frequency signals. The analog RC filter is limited by the capacitance and the frequency cannot be too low, and the flexibility is good, and different filtering methods can be changed by changing the program.4) Watchdog. Sometimes the single-chip microcomputer will execute the program out of order when it accepts electromagnetic interference. If the program enters an endless loop, the single-chip microcomputer will crash. The way to solve this problem is to add a watchdog to the system.Add the following program in each program segment:Among them, YS is the delay subroutine, WATCHDOG is the watchdog subroutine, the counting value (counting time) of the counter should be greater than the cycle time of the main program once, otherwise the system will always reset and cannot run normally. During normal operation, every time the program runs LCALL WATCHDOG, a pulse is sent from P2.7 to clear the counter, and its Qn output terminal is always at low level, which will not reset the system. Once the system is disturbed by electromagnetic interference, the program enters an endless loop. If the program cannot be executed normally, the pulse cannot be sent from P2.7, which will make the counter full and Qn be covered with "1" and send it to the RESET pin of 8051 through the 47uF capacitor to reset the system and execute the main program again.SummarizeIn the design of single-chip application system, as long as the hardware composition of the system is carefully analyzed, the components are carefully selected, the interference sources and sensitive components are confirmed, and the reasonable layout of them can improve the stability of the system. Practice has proved that only by taking measures from two aspects of hardware and software, with hardware anti-interference technology as the main and software anti-interference technology as a supplement, the combination of the two can effectively eliminate the influence of interference signals and improve system stability.The above is the research on electromagnetic interference technology of single-chip microcomputer application system introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions for Jieli, Ankai, Allwinner, Realtek, etc., and also develop BLE Bluetooth ICs, dual-mode Bluetooth modules, wifi modules, and IoT modules. We have hardware design and software development capabilities. Covering circuit design, PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development, voice recognition technology, Bluetooth development, wifi technology, etc. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the research and development of electronic education products.