- Home >> Technical Service >> MCU
SCM system design process
1. Single-chip application system design process
1.1 Requirements for design of single-chip microcomputer application system
When designing a single-chip application system, first select components with high reliability to avoid damage to the reliable operation of the system, and at the same time eliminate unstable factors in the circuit. Secondly, in the design process, the structure of the system should be modularized and standardized, and the control switches should not be too complicated or too many, so that it is easy to find and eliminate faults. Finally, it is necessary to optimize the system design, simplify the peripheral hardware circuit, and make the operation sequence of the system simple and clear. When necessary, consider whether the software should be equipped with an encryption function, so that the user program solidified in the microcontroller will not be illegally copied.
1.2 SCM application system composition
Hardware and software constitute the two basic components of the microcontroller application system. CPU, storage area, several I/O interfaces and peripheral equipment etc. constitute the hardware part. Among them, the single-chip microcomputer is the core component of the whole system, which can run programs and process data. The memory is used to store the program and data of the one-chip computer, and the I/O interface is the information exchange channel between the one-chip computer and the external controlled object. The specific circuit diagram is shown below. Real-time software and development software constitute the software of the single-chip microcomputer system. The software written for different single-chip control system functions is real-time software, and the software used in the development and debugging of the control system is called development software, such as assembly software, compilation software, simulation and debugging software, programming download software, etc.
1.3 SCM application system design
The development of single-chip microcomputer application system can generally be divided into five stages. The task of the first stage is to determine the overall design plan. It is necessary to complete the user demand analysis and plan research. The purpose is to clarify the design target of the application system through the understanding of the market and users. technical indicators. Conduct feasibility analysis based on demand analysis and program research. The purpose of feasibility analysis is to make a clear judgment on the necessity and feasibility of system development and decide whether to continue the development work. Then design and supervise a logic model for the whole system, including necessary theoretical analysis and calculation, selection of models, division of system software and hardware functions, rational matching of software and hardware proportions, and determination of the division of system software function modules and each function module The program implementation method, and draw a flow chart. The main task of the second stage is the detailed design and production of the system, mainly including hardware design and software design. The task of hardware design is to design the hardware circuit schematic diagram of the system and preliminarily design the printed circuit board according to the overall design requirements. The hardware structure should be considered in conjunction with the software, replace the hardware with software as much as possible, simplify the hardware structure, and properly consider the bus drive capability of the CPU, pay attention to reliability and anti-interference design.
The task of software design is to determine the program structure on the basis of overall design and hardware design, allocate internal structure memory resources, divide functional modules, design the main program and each module program, and finally complete the control program of the entire system. The third stage is simulation debugging, which is divided into three processes: hardware debugging, software debugging and system joint debugging. Hardware debugging is to use the basic test instruments (multimeter, oscilloscope, etc.) of the development system to check the faults existing in the user system hardware by executing relevant commands or test programs of the development system. During software debugging, the process of assembling, linking, and executing the user program is to find out the grammatical errors and logical errors in the program and eliminate and correct them. System joint debugging refers to allowing the software of the user system to actually run on its hardware, and to perform software and hardware joint debugging. The task of the fourth stage is to solidify the program and run independently. The task of the fifth stage is the document preparation stage, and the document should include task description; design guiding ideology and design scheme demonstration; performance measurement and on-site trial report and description; trial guide; software information (flow chart, subroutine instruction, address assignment , program list); hardware information (circuit schematic diagram, component layout and wiring diagram, connector pin diagram, printed circuit board diagram, precautions, etc.).
2. Selection of MCU
2.1 Performance indicators of single-chip microcomputer
The current single-chip microcomputer has several types such as 4-bit machine, 8-bit machine, 16-bit machine and 32-bit machine. The number of bits of a microcontroller is determined by the number of bits of its core CPU. The more bits, the stronger the ability of the microcontroller to process data. The operating speed of the microcontroller depends on the frequency of the external crystal oscillator or external clock signal. For example, the external clock frequency of 89C51 can reach 24MHz. The higher the running speed of the single-chip microcomputer, the higher the speed block will be executed, but the power consumption will increase accordingly. The program memory structure types of single-chip microcomputer mainly include ROM and RAM. General single-chip microcomputers all have data storage RAM, but their capacity is not large. When a large amount of data needs to be stored, an external user RAM should be considered. The single-chip microcomputer has a strong interrupt processing capability, and the 51 single-chip microcomputer generally has five interrupt sources, which are external interrupt 0, external interrupt 1, timer counter 0, timer counter 1 and serial port interrupt. In some automatic monitoring instruments and battery-powered products, low power consumption is the main technical index. Usually, the single-chip microcomputer using HC-MOS technology works at low voltage. The size of the board, the processing method, the purchase method and the cost are considered comprehensively.
2.2 Selection principles of MCU
There are generally three principles for the selection of single-chip microcomputers. One is the system adaptability of the single-chip microcomputer, which refers to whether the single-chip microcomputer can be used to complete the control tasks of the application system. The main factors to be considered are: whether there is suitable computing and processing capability? whether there are required peripheral port components? whether there are required interrupt sources and timers? whether there are required I/O ports? Developability, the use of development tools is a necessary means for the development of single-chip microcomputer application systems, and is an important basis for selecting single-chip microcomputers. The main considerations are: development environment, debugging tools, online BBS service and application support. The third is the history of the manufacturer and the availability of the product. It is necessary to consider whether the price/performance ratio of the product is reliable? Is it discontinued?
3. Anti-interference technology of single chip microcomputer
3.1 Sources of Interference
The noise outside the signal or the change part that causes adverse effects is collectively called interference. In the process of developing single-chip microcomputer application products, we often encounter a very difficult problem, that is, the system runs normally in the laboratory environment, but after small batch production and installation on the work site, some irregularities and irregularities appear. Very normal phenomenon. The main reason is that the anti-interference design of the system is not comprehensive, which leads to the unreliable operation of the application system. There are three main reasons for the interference of the single-chip microcomputer control system, namely, the interference of the power supply system, the interference of the process channel, and the interference of space electromagnetic waves. The on and off of the power switch, the start and stop of the motor and large electrical equipment will cause fluctuations in the power grid. Affected by these factors, there are often hundreds of volts or even thousands of volts of spike interference on the grid. In the application system of the one-chip computer, the channel of switch quantity input, output and analog quantity input and output is indispensable. These channels will inevitably make all kinds of interference directly into the microcontroller system. Space interference mainly comes from electromagnetic waves radiated by the sun and other celestial bodies, electromagnetic waves emitted by radio stations or communication transmitters, and electromagnetic interference emitted by various surrounding electrical equipment. Therefore, in response to the above problems, we must take effective measures to improve the anti-interference ability of the single-chip application system
3.2 Hardware anti-jamming technology
Commonly used hardware anti-jamming technologies mainly include isolation technology, grounding technology, decoupling technology, filtering technology and shielding technology. In the single-chip microcomputer system, in order to improve the quality of the power supply system and prevent human interference, it is recommended to separate the single-chip microcomputer input power supply from the power supply of strong electric equipment, use an isolated power transformer with electrostatic shielding and anti-electromagnetic interference, and use independent function blocks for separate power supply , and achieve two-stage voltage regulation with an integrated voltage regulator block. Increase the power supply voltage of the interface device as much as possible to improve the anti-interference ability of the interface. The process channel is the path for information transmission between system input, output and single-chip microcomputer. Because the connection line between the input and output objects and the microcontroller is long, it is easy to scurry into the interference and must be suppressed. Generally, twisted pair transmission is used to reduce electromagnetic induction and suppress noise interference, and filter circuits, monostable circuits, trigger circuits and Schmidt circuits are used to suppress the vibration of mechanical electric shocks, thereby suppressing noise interference. In the single-chip microcomputer system, the quality of the printed circuit board design has a great influence on the anti-interference ability. Printed circuit boards are important components used to support circuit components and provide electrical connections between circuit components and devices. In order to reduce interference, a printed circuit board with a moderate size and a reasonable layout is often used, and the decoupling capacitor is reasonably configured, and the power line and bottom line are correctly designed.
3.3 Software anti-jamming technology
The anti-jamming performance of the single-chip microcomputer application system cannot be completely solved by hardware, and the software anti-jamming design is also an important way to prevent and eliminate application system failures. Once the single-chip microcomputer causes the program counter PC to deviate from the original value due to interference, the program will deviate from the normal running track, and the operand value will change or the operand will be regarded as the "running away" phenomenon of the operation code. At this point, software traps and "watchdog" techniques can be used to restore the program to a normal state. The so-called software trap refers to a series of instructions that can restore a chaotic program to normal operation or restore a "runaway" program to its initial state. Such as NOP instruction, LIMP instruction, etc. The program running monitoring system is also called "watchdog". "Watchdog" is a swordsman tracking timer, the application of "watchdog" technology can make the single chip microcomputer return to normal state from the infinite loop. "Watchdog" can be realized by hardware circuit, or by internal timer/counter by software technology. At present, most single-chip microcomputers are integrated with a program running monitoring system.
The above is the development process of the single-chip microcomputer application system introduced by Shenzhen Zuichuang 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 Songix single-chip microcomputer and Yingguang single-chip microcomputer agent, selling and developing the MCU and voice IC solutions of Songix 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.
- TOP