How to become a master in single chip microcomputer development
[Copy link]
Single-chip microcomputers are suitable for many fields such as electronic toys, industrial control, household appliances, mechatronics products, aerospace and navigation, etc., and the application development of single-chip microcomputers is not only the development of software, but also closely related to the development language and hardware. Therefore, only when the developer has a good understanding of the internal structure of the single-chip microcomputer can he write good software. The development and application of single-chip microcomputers also involve hardware expansion interfaces and various sensors. More importantly, it is necessary to understand the control projects and control processes in various disciplines that are suitable for single-chip microcomputers as much as possible.
It takes a process to master the application development of single-chip microcomputers. First of all, you must master the knowledge of digital circuits and analog circuits, and you must also learn the principles of single-chip microcomputers, hardware structures, expansion interfaces and programming languages. Due to lack of experience in the first development, it may take many repetitions to complete the project. At this time, you will get greater gains and accumulation, which is reflected in the following aspects:
accumulation
of hardware design; accumulation of software design;
accumulation of design experience.
Hardware development is the basis of single-chip microcomputer application development, and software development is based on hardware. The ingenious combination of hardware and software design is the key to project development quality assurance. In the development and design of single-chip microcomputer hardware, the following aspects should be noted:
single-chip microcomputer application developers must learn to apply the latest single-chip microcomputer (MCU). The advantages of the new MCU are further improved in clock frequency (from 6MHz to 33MHz), improved instruction execution speed (from 12 machine cycles to 6 machine cycles, or even to 1 machine cycle), improved processor-related functions (such as the addition of mathematical processing, fuzzy control, etc.), further expansion of internal program memory and data memory capacity (ROM expanded to 64K, RAM expanded to 2K), internal integration of A/D and D/A converters, internal integration of functional modules such as LCD display, and enhanced external expansion functions. For example, Philips' P89C884 single-chip microcomputer has 64K FLASH (flash memory), 3 counters, 33MHz clock, 6 machine cycles to execute one instruction, I2C bus, ISP/IAP, etc.
The development of the expansion interface should be developed using devices such as PSD, FPGA (or CPLD) as much as possible. These devices are supported by the development platform, with less development difficulty, and the developed hardware has reliable performance, compact structure, easy modification, and good confidentiality. This method is also the trend of hardware interface development. For example, the EPM7128S produced by Altera is widely used and is also easy to buy in the Chinese market; the new programmable microcontroller peripheral device PSD813F launched by WSI combines many functional modules in the microcontroller peripheral circuit to provide users with a smaller, lower-cost and faster-development solution.
After the expansion of standard serial ports such as RS-232, the microcontroller can communicate with the PC, and complement the advantages of many measurement and control functions such as human-computer dialogue, report output, and integrated control. If the chip supports 1SP/IAP functions, online simulation, remote debugging, and remote software upgrades can also be performed. For example, Dallas's 1-bit bus interface and Philips' I2C bus interfaces are equipped with more dedicated expansion interfaces, which are very convenient to expand. The software they are equipped with has a standard mode and is also easier to write.
C language is the most widely used programming language. It has various characteristics of high-level languages, can operate hardware, and can perform structured programming. Programs written in C language are easier to transplant. At present, there are C language compilers designed specifically for microcontrollers, such as Franklin C51 and KEIL C51. They can generate concise and reliable target codes, which are completely comparable to assembly in terms of code efficiency and code execution speed.
Sometimes when developing a microcontroller application project, the system runs normally after the simulation and debugging is completed, but it cannot run normally after being connected to the site or runs well and badly, and everything is normal after leaving the site. This phenomenon involves reliability issues. To solve this problem, we can consider the following aspects:
1. Choose a power supply system with good performance and strong anti-interference ability, and introduce as little interference as possible from the power supply;
2. When designing the circuit board, exclude factors that may cause interference, and arrange the wiring reasonably to avoid interference from high-frequency signals. Figure 1 shows reasonable wiring and unreasonable wiring:
3. Choose a better grounding method, such as using a single-point grounding method for analog ground and digital ground, and using photoelectric isolation when driving large current signals;
4. Perform digital filtering during data acquisition. Common digital filtering methods include: program judgment filtering, median filtering, arithmetic average filtering, recursive average filtering, pulse interference prevention average filtering, first-order lag filtering, etc.
Since the interference problem may be caused by different reasons, the possible interference should be analyzed according to the project application site during design, and the anti-interference circuit should be designed purposefully.
Another simpler way to develop a single-chip microcomputer application project is to use the "single-chip microcomputer application development platform". Xi'an Beidouxing Company also plans to launch the 1.0 version of this "single-chip microcomputer application development platform" in the near future.
Among them, the development platform part provides users with a simple and convenient development environment, so that users can visually develop single-chip microcomputer application projects.
The hardware intelligent development part provides a method to develop hardware schematics through options. In this process, a part of supporting software is automatically generated according to the hardware solution platform.
Visual software development can easily and conveniently develop user programs. There are a large number of successfully developed projects in the finished system library. When developing products, if the development projects have similar functions, they can become new projects with just a slight modification. The finished system library development provides an open environment for users to upgrade the finished library.
The subroutine development provides an open environment for subroutine upgrades. The practical information part provides a lot of practical information used in development.
Developing single-chip microcomputer application projects on the platform is different from the traditional development model. The platform integrates a large number of excellent design ideas of professional technicians. Using the single-chip microcomputer development platform can enable technicians to grow rapidly and completely eradicate a large number of low-level repetitive work in product development. The knowledge integration of the platform reduces the dependence of enterprises on individual technicians, and the flow of technicians will not affect the technical strength of the enterprise. The maximum inclusiveness of the platform greatly shortens the product development cycle. The reliability accumulation of the platform ensures that the products developed based on the platform have good reliability. The standardization, systematization and normalization of the platform are very beneficial to the large-scale production, after-sales service and product updates of embedded products. Only by adopting the platform development model can the application development of single-chip microcomputers be promoted to a new stage.
For more technical articles, please visit: www.threeway.cc
|