① Necessary equipment: computer, simulator, programmer, digital multimeter, electric soldering iron, pliers, screwdriver and other tools. The simulator is used to debug the program. Different single-chip computers need different simulators. For example, the 51 series single-chip computer needs the 51 series single-chip simulator. There are general simulators and special simulators. The general simulator is suitable for multiple series and has a high price; the special simulator is only suitable for a certain series and has a low price. The programmer is used to solidify (or write) the chip. The programmer is also divided into simple type and general type. The difference between the two is mainly the number of solidified chips. The former has a small number and the latter has a large number. The price difference is also very large. Beginners can choose a simple programmer that can solidify the chip they use. Whether it is simulation or programming, it needs to be connected to the computer, and the simulation or programming is done through the computer.
② Other equipment: dual-trace oscilloscope, multi-function signal generator, DC regulated power supply, etc.
2. Overall design
The overall design is divided into two types: product structural design (or mechanical design) and electrical design.
The structural design mainly considers the shape, volume, and panel size of the product; the layout of buttons, indicator lights, and displays on the panel; the size of the instrument backplane, how to introduce signal lines and power lines on the backplane; how to arrange the wiring terminals, etc.
Electrical design includes software and hardware design, the selection of single-chip microcomputers, the selection of peripheral circuit devices, the selection of programming languages, etc. In the end, the structural block diagram of the single-chip microcomputer application system should be drawn, and the block diagram of the selected single-chip microcomputer and the block diagram of each functional block should be included in the structural block diagram.
3. Hardware design
Hardware design mainly refers to the design of hardware circuits that can realize the required functions. Draw the circuit schematic diagram based on the system structural block diagram designed in the previous overall design, and then draw the printed circuit board diagram in combination with the product structure and process design. When designing the hardware of the single-chip microcomputer application system, the following should be considered:
① The specific circuit involved in the hardware design should first be a ready-made circuit that you have used in other projects before. You know best whether this circuit is good or not. Secondly, learn from other people's circuits. Note that when using other people's circuits, you must debug them first and cannot put them directly in the circuit.
② The hardware circuit adopts modular design. For example, a single-chip microcomputer application system has a single-chip microcomputer minimum system, a clock circuit, an A/D conversion circuit, an LED or LCD display circuit, a serial communication circuit, etc., which can be designed as independent modules. The advantage of modular design is that it can be "divide and conquer". If each module is debugged, the hardware of the entire system is basically debugged, and the debugged modules can be easily transplanted to other single-chip microcomputer application systems.
③ Choose components with sufficient market supply and common use, especially integrated circuit chips. Exclusive products cannot be selected. Exclusive products are firstly too expensive, and secondly, once out of stock, there is nothing to do.
④ When designing hardware circuits, the driving capabilities of each part of the system must be fully considered. If the driving capabilities are insufficient, the system cannot work reliably or cannot work at all.
⑤ When drawing the circuit schematic, the structural design and process design of the product must be fully considered. It must be completed before making the printed circuit board diagram, otherwise the number, size and shape of the printed circuit board cannot be determined.
⑥ There are many popular tools for drawing circuit diagrams, among which Protel 99SE/Protel DXP is the best and most commonly used. However, when using Protel 99SE/Protel DXP to draw printed circuit boards, the problem of electromagnetic interference must be fully considered.
⑦ When using Protel 99SE/Protel DXP to draw printed circuit board diagrams, there are several minimum size values that must be paid attention to: the line width should generally be greater than or equal to 15mil; the via diameter should not be less than 30mil; the line spacing (the minimum spacing between two adjacent lines) should not be less than 10 mil. Mil is the imperial unit of length, which is one thousandth of 1in (1in=0.0254m).
⑧ When drawing printed circuit board diagrams, the width and spacing of most component pins are standard, but some multi-pin connectors are difficult to draw. Even if they are measured with a vernier caliper, sometimes they cannot be plugged in. The solution is: after drawing the PCB diagram, print a copy at a ratio of 1:1, then find a relatively flat piece of plastic foam, paste the PCB diagram on it, and then insert the components to see if it fits. If not, modify it again until it fits.
4. Hardware debugging
Hardware debugging is performed on the PCB with components soldered on. The steps are as follows:
① Check the PCB. Before installing and soldering the components, check with your eyes and a multimeter whether there are short circuits and open circuits on the PCB.
② Pay attention to the direction of the components during installation. Keep the PCB surface clean during soldering, and pay attention to whether there are leaks, wrong soldering, or continuous soldering.
③ Power on without load. Check whether the power output is correct, whether the power and ground potentials on the microcontroller pins are correct, and whether the power and ground potentials on other integrated chips are correct.
④ Power on. After the no-load power-on check is correct, you can insert each chip into each socket, officially power on, and then check whether the potentials of each point are correct. If the potential is not right or a component is hot or even smoking, turn off the power immediately and find the cause until the fault is eliminated before turning on the power again.
⑤ Simulation debugging. The emulator of the microcontroller is a special tool to help designers debug the application system. Without power, first connect the emulator to the parallel port, USB port or serial port of the PC, and then insert the emulator head into the dedicated socket of the microcontroller application system. In this way, the microcontroller, emulator and PC constitute an online development system.
5. Software design
In software design, the following points should be noted:
① Similar to hardware design, the program involved in software design to realize a certain function is first of all a ready-made program module that has been used in other projects before; secondly, learn from other people's program modules, the specific way is to search on the Internet, including hardware circuits and source code, and also must be debugged before use.
② Software design should also be modular. The advantage of modularization is that it is easy to test, modify and expand. Debugging work can be carried out in parallel, and several debuggers can debug different modules at the same time.
③ Reasonably allocate memory resources, reserve enough RAM area for the stack, and do not let the stack overflow.
④ Use anti-electromagnetic interference measures in software, such as using software filtering when sampling; software cooperation is also required when using the watchdog circuit.
⑤ To improve the readability of the program, add necessary comments to the program module.
⑥ Choice of programming language. Assembly language is the language used in the early development of single-chip microcomputers. Due to its shortcomings such as poor readability, portability, and maintainability, it has gradually been replaced by C language. C language is a concise and efficient high-level language with good readability, high reliability, rich function library, fast computing speed, high compilation efficiency, good portability, etc., and can directly realize the control of hardware. Therefore, it has gradually become the mainstream programming language in the development of single-chip microcomputer application systems.
6. Software debugging
Software debugging is related to the selected software structure and programming technology. If modular programming technology is used, after adjusting each module one by one, the system program will be debugged.
For modular structure programs, each subroutine should be debugged separately. When debugging a subroutine, it must meet the on-site environment, that is, the entry and exit conditions. The means of debugging can be single-step operation mode and breakpoint operation mode. By checking the site of the user system CPU, the content of RAM and the status of the I/O port, the program execution result can be detected to see whether it meets the design requirements. Through detection, dead loop errors, machine code errors and transfer address errors in the program can be found. At the same time, hardware failures, software algorithms and hardware design errors in the user system can also be found. During the debugging process, the software and hardware of the user system are constantly adjusted, and program modules are gradually passed.
After each independent program module is debugged, the functional blocks can be combined to conduct comprehensive debugging of the overall program. If a fault occurs at this stage, it can be considered whether each subroutine destroys the site during operation, whether the buffer unit conflicts, whether there is a design error in the establishment and clearing of the zero position, whether the stack area overflows, whether the status of the input device is normal, etc. (Copyright http://www.diangon.com/) If the user system is running under the monitoring program of the development system, it is also necessary to consider whether the user buffer unit conflicts with the working unit of the monitoring program.
After single-step and breakpoint debugging, continuous debugging should also be performed. This is because single-step operation can only verify whether the program is correct or not, but cannot determine the timing accuracy, real-time response of the CPU and other issues. After all are completed, it should be run repeatedly for many times. In addition to observing the stability, it is also necessary to observe whether the operation of the user system meets the original design requirements and whether the arranged user operations are reasonable. If necessary, appropriate corrections should be made.
7. Curing
After the target program is debugged by the emulator, it can be cured. The machine code generated by the source program after compilation and connection has two formats (*.HEX format or *.BIN format) and can be cured. There are two methods of curing: one is the curing function equipped with the emulator; the other is a dedicated programmer. There are many kinds of dedicated programmers, which are divided into simple and general programmers. The former can cure a small number of chips, while the latter can cure a large number of chips.
8. Run test
The run test includes functional testing and reliability testing. Functional testing is to check whether each function is realized one by one according to the design task book. Reliability testing, also known as "baking machine", has an uncertain "baking machine" time, which can be 48 hours, 72 hours or longer. The purpose is to test whether the system can operate normally within the specified time. In addition to testing the running time, high temperature and low temperature tests and anti-electromagnetic interference tests are also required. When both the functional test and the reliability test are passed, the microcontroller application system is successfully developed.
Previous article:The main interference forms of single chip microcomputer application system
Next article:Single chip microcomputer application system and its composition and classification
Recommended ReadingLatest update time:2024-11-17 00:00
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Are ADC accuracy and resolution the same thing?
- Won't boot!!! How wrong is this schematic?
- Lide Huafu Dongfang Hitachi Mingyang Longyuan
- EEWORLD University ---- RISC-V Processor Design Series
- [NUCLEO-L552ZE Review] +RT-Thread Porting
- Single source shortest path - Dijkstara algorithm
- About fatalerror in Modelsim simulation
- Several concepts about switching power supply
- Review summary: Shanghai Hangxin ACM32F070 development board + touch function evaluation board
- Register Control of LMX2592