Current location - Training Enrollment Network - Mathematics courses - What changes need to be made to transplant the project from Keil to IAR?
What changes need to be made to transplant the project from Keil to IAR?
Cost control in the design stage of electronic products

Try to use various EDA (Electronic Design Automation) tools. The comprehensive use of various EDA tools to complete the design can greatly speed up the development progress, reduce errors and improve the engineering quality. When it comes to EDA tools, many people will think of circuit board wiring software such as Protel, Orcad and Pads. In fact, these tools include not only schematic diagram and circuit board wiring, but also modules such as programmable logic device (PLD) design and signal simulation. Make full use of these functions, you can often find many ideas and drawings defects in the design stage. It has a multiplier effect on reducing rework and modification in the design stage. In addition, there are some other kinds of software, which are not specialized electronic design software, but we can still borrow them. For example, if the project contains some complex mathematical algorithms (such as fuzzy logic and artificial neuron algorithm), we can also use special mathematical CAD software-MATLAB to simulate your signal processing flow first, and then design related hardware and software according to the simulation results. Repeatedly writing films and debugging algorithms on the target machine saves a lot of time.

When designing the circuit, it is inevitable to modify the hardware. In order to facilitate circuit modification, attention should be paid to the plasticity of the circuit. The plasticity of the circuit refers to the modifiability of the circuit. If the circuit is easy to modify, it will reduce the low-level labor of many developers to modify the circuit. There are several ways to improve the plasticity of the circuit:

1. Functions that can be realized by software should not be realized by hardware. Due to the different physical structures of hardware and software, the cost of modifying hardware is much higher than that of modifying software. Replacing hardware with software can also reduce the cost of finished products and facilitate mass production and sales.

2. If there are CMOS and TTL circuits in the circuit, PLD (Programmable Logic Device) should be used as much as possible, because PLD itself has modifiable characteristics. After using them to realize digital logic, when changing the logical relationship, we only need to modify their logical description files on the computer, and we can get a new integrated circuit with logical relationship after compiling and writing. As simple as modifying software. Replacing different commonly used digital integrated circuits with PLD is beneficial to reduce the types of components. Convenient procurement and inventory management.

3. Leave more resources on the circuit board during the trial production. For example, the capacity of PLD is slightly larger than your expected capacity, and the ROM, RAM, I/O port and other resources of single chip microcomputer should have appropriate spare space. Because there are many unpredictable situations in the design process at any time, solving these problems usually increases the demand for hardware resources. If proper redundant resources are not reserved on the circuit board, a small circuit board will have to be built outside the circuit board. Facts have proved that modifying the circuit in this way will not only easily introduce interference signals into the circuit, but also greatly reduce the reliability of the prototype, and at the same time make technicians spend a lot of time on the simple work of repeatedly modifying the circuit.

When writing the software of single chip microcomputer, we should try to write it in high-level language. At present, many technicians who develop single-chip computers still retain the development methods of the 1980 s. Using assembly language, write instructions one by one, and allocate memory resources manually in single chip microcomputer. This method can be used to write small-scale software, but once the scale of the software becomes larger, designers are often confused by the complex logical relations in their own software because of the low readability and poor structure of assembly language. After the logical relationship of a software is confused, it is difficult to ensure that the written software can run safely. We recommend using C language to write the code of software single chip microcomputer. (For the common 805 1 series, we generally use software such as KEIL and FLANKLIN. Other types of single-chip computers generally have their own C language compiler, which can be provided by the dealers of this type of single-chip computers. There are several advantages to using C language:

1. can greatly speed up the development progress.

2. Structured programming of the software can be realized, so that the logical structure of the software is clear and organized.

3. It is much more efficient than assembly language to write some mathematical algorithms, loops and judgment statements.

4. The manual allocation of memory resources is saved. In assembly language, we must allocate space for each subroutine to store variables, which is a complicated, boring and error-prone job. After using C language, as long as you state the type of variables in the code, the compiler will automatically allocate registers and memory for you, and the computer will do anything that is easy to make mistakes in low-level repetition. There is no human intervention at all.

5. Because loops, judgment statements and variable names all use natural language, the code written has good maintainability and software readability. In this way, when software developers need to change, it is easier to transfer and digest the code. Even if they don't change people, it is easier for them to maintain their own code.

6. After writing an algorithm, when you need this algorithm on different kinds of CPU in the future, you can refer to the original code directly and recompile it with this CPU-specific compiler. This can realize low-cost cross-platform transplantation of software. In this case, the assembly language has no choice but to rewrite the code. Because of this characteristic of C language, if we design complex algorithms (such as video/audio signal processing, fuzzy logic and artificial neuron algorithm, etc. ), we can use C language compilers on x86 platforms such as Visual C++ and C++ Build to design and debug the code of this algorithm, and after debugging, it can be transplanted to the software system of single chip microcomputer. Because there are enough system resources on the PC, the development and debugging progress will be greatly improved, thus saving the time cost of the software.

7. In group writing software, the software interface is easy to standardize and unify.

Although the code written in C language will occupy 5%~20% more space than the assembly language, the capacity and speed of the chip have been greatly improved due to the development of semiconductor technology. In this case, the difference in the space occupied by the code is not very critical. In contrast, we should pay more attention to whether the software can run stably for a long time and the time and cost advantages brought by using advanced development tools.