Introduction
Nowadays, embedded devices exist in every corner of people's lives, such as DVDs, mobile phones, MP3s, and PDAs. Most of these embedded devices use 32-bit RISC embedded processors as core components. Among them, embedded processors based on ARM cores are the best, accounting for more than 75% of the market share in 32-bit RISC processors. Therefore, more and more electronics enthusiasts have joined the team of learning ARM. By comparing with the development process of general single-chip microcomputer systems, it is not difficult to find that the design of embedded systems includes two aspects: hardware design and software design, and its debugging process includes three processes: software debugging, hardware testing, and system debugging. Software debugging is generally easier to carry out, but hardware testing and system debugging are more troublesome, because these two processes must be carried out after PCB production and component welding are completed; and PCB production and component welding are very time-consuming and labor-intensive. If the simulation tool Proteus VSM can be used, the above work can be completed without making a specific circuit board. There is no doubt that this will bring great convenience to the majority of ARM learners.
1 Introduction to Proteus
Proteus software is an EDA tool software from Labcenter electronics in the UK. It is an electronic design teaching platform, experimental platform and innovation platform, covering all the functions of electrical and electronic laboratories, electronic technology laboratories, and single-chip microcomputer application laboratories. It runs on the Windows operating system and can simulate and analyze (SPICE) various analog devices and integrated circuits. The features of this software are:
① It realizes the combination of single-chip microcomputer simulation and SPICE circuit simulation. It has the functions of analog circuit simulation, digital circuit simulation, simulation of systems composed of single-chip microcomputers and their peripheral circuits, RS232 dynamic simulation, I2C debugger, SPI debugger, keyboard and LCD system simulation; there are various virtual instruments such as oscilloscopes, logic analyzers, signal generators, etc.
② It supports the simulation of mainstream single-chip microcomputer systems. The types of single-chip microcomputers currently supported are: 68000 series, 8051 series, AVR series, PIC12 series, PIC16 series, PIC18 series, Z80 series, HC11 series, and Phil-lips' ARM (LPC series).
③ It provides software debugging functions. In the hardware simulation system, it has debugging functions such as full speed, single step, and breakpoint setting. At the same time, it can observe the current status of various variables, registers, etc., so these functions must also be available in the software simulation system; at the same time, it supports third-party software compilation and debugging environments, such as Keil, ADS and other software.
④ It has powerful schematic drawing functions. It can design SCH (schematic) and PCB (printed board) circuits.
2 Schematic design under Proteus environment
Proteus is similar to Protel, EWB and other software. To draw a schematic diagram, you must first take out the required component symbols from the device library and lay them out in the drawing area, edit the parameters of the components, and then connect them, add necessary network labels and other steps. The following is a simple example to illustrate how to use Proteus software to implement the design and simulation of ARM (taking LPC2106 as an example) system. The example takes the LPC2106 controller as the core, uses the hardware SPI interface to connect to the 74HC595, adds the necessary peripheral circuits, and controls the 74HC595 to drive the LED digital tube display. The circuit principle is shown in Figure 1. P0.4 (/SCK/CAP0.1), P0.6 (/MOSI/CAP0.2) and P0.8 (/TxD1/PWM4) of LPC2106 are respectively connected to SH_CP, DS and ST_CP of 74HC595 to control 74HC595. The outputs Q0~Q6 of 74HC595 are respectively connected to the digital tube and LED to control their real-time display.
3 Program code writing
The program code writing is mainly divided into 4 parts:
① LPC2106 initialization code;
② LPC2106 exception vector entry and the interface between the exception vector and the C language code, including the code for initializing the stack;
③ LPC2106 target board special code, including the exception handler and the target board initialization program;
④ According to the example requirements and combined with the schematic diagram, write the code to achieve the expected function, that is, the usual execution code, and save the code file as "main.C". [page]
In order to save development time, we usually use a designed project template. Here we use the LPC2100 series project template. The template contains the startup files of the LPC2100 series ARM7 microcontroller, including STACK.S, HEAP.S, STARTUP.S and TARGET.C; the template also contains the header files of the LPC2100 series ARM7 microcontroller, scattered loading description files (such as mem_a.scf, mem_b.scf and mem_c.scf), etc. In this way, you can directly use these project templates when writing program codes in the future, without having to write initial and startup program codes. You only need to write "main.C" according to different requirements, thus saving a lot of time and greatly improving work efficiency.
Here we mainly explain the writing of "main.C". The function to be realized is to use the hardware SPI interface to output data from 0 to F, control the LED digital tube to display characters from 0 to F through 74HC595, and control 4 LEDs to display the corresponding hexadecimal numbers. The program source code is as follows:
4 Simulation
Use the ADS integrated development environment to compile and connect the program. The ADS integrated development environment is an integrated development tool for ARM core microcontrollers launched by ARM. The full name in English is ARM Developer Suite, and the mature version is ADS1.2. ADS1.2 supports all ARM series microcontrollers before ARM10, supports software debugging, supports assembly, C and C++ source programs, and has the characteristics of high compilation efficiency and strong system library functions. Open the ADS1.2 integrated development environment CodeWarrior IDE, use the pre-added project template to create a new project spi.mcp, and add the above compiled code file main.c to the project. After making relevant settings, select Projeet→Make command, compile and connect the project, and generate spi.hex file.
Double-click the microcontroller LPC2106 in the schematic diagram, and a property setting window Edit Component will appear, as shown in Figure 2. Add the path of the spi.hex file generated above in ProgramFile, and click OK to complete the setting.
Click the Run button in the lower left corner of the schematic to start the simulation. The digital tube displays the data O~F sent by SPI, and the LED displays the corresponding hexadecimal value. The simulation results fully meet the design requirements.
Conclusion
This article explains the application of Proteus in ARM development in detail by combining a simple SPI interface experiment. It can be seen that Proteus is very powerful and can simulate various digital analog circuits. It is simple to operate and easy to use. Using Proteus for virtual development of ARM can not only reduce the investment in experimental hardware capital, but also break through the limitations of experimental content in the actual development board, so that developers can give full play to their own initiative. After the successful virtual development of the system using Proteus simulation, actual production can undoubtedly improve development efficiency, reduce development costs, and increase development speed, and has a high value of promotion and application.
Previous article:ARM7 keyboard and VFD display interface technology
Next article:Design of embedded remote measurement and control system based on ARMlinux
Recommended ReadingLatest update time:2024-11-16 20:48
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- Single-chip microcomputer C language programming and simulation
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Single chip microcomputer control technology (Li Shuping, Wang Yan, Zhu Yu, Zhang Xiaoyun)
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
- 【NUCLEO-L552ZE Review】+wifi module
- Questions about LM317 circuit
- Forward - I've learned a lot. Have you ever seen the cross-section of a BGA packaged chip?
- The most complete circuit testing process
- Driver recommendations for three-phase current-source PWM rectifiers
- Clock switching glitch free
- Difference between ARM7 and ARM9
- What do you think of the MicroPython trademark incident?
- [Project source code] [Modelsim FAQ] Port 'xxxx' not found in the connected module
- An error in the CC3200 Out of Box Application example