1. Introduction
Single-chip microcomputers are widely used in many products, whether it is the 51 series, AVR, or PIC series, they all have their own characteristics, and the number of learners is increasing year by year. However, in the process of learning and development, we often spend a lot of money on experiments after determining the plan, especially for some students or beginners, which may become an obstacle to their learning. Since we used Proteus software, we have greatly saved time and development costs. In particular, using this software in single-chip microcomputer development is a good choice. Here we mainly talk about the combination and application of Proteus software and Keil software.
2. Introduction and application of Protues software
2.1 Introduction to Protues software
Proteus is currently the best tool for simulating single-chip microcomputer peripheral devices. It can simulate 51 series, AVR, PIC and other commonly used MCUs and their peripheral circuits (such as LCD, RAM, ROM, keyboard, motor, LED, AD/DA, some SPI devices, some IIC devices...). This article is based on ProteusPRO6.7SP3 and KEIL uVision3 software. Of course, the software simulation accuracy is limited, and it is impossible to find the corresponding simulation model for all devices. Using a development board and simulator is of course the best choice, but for microcontroller enthusiasts or simple development, it should be a better choice. Proteus is different from other microcontroller simulation software in that it can not only simulate the working conditions of the microcontroller CPU, but also simulate the working conditions of the microcontroller peripheral circuits or other circuits without the participation of the microcontroller. Therefore, when simulating and debugging the program, the concern is no longer the changes in the contents of the microcontroller registers and memory when certain statements are executed, but directly looking at the process and results of program operation and circuit operation from an engineering perspective. For such simulation experiments, in a sense, it makes up for the contradictions and phenomena of disconnection between experiments and engineering applications.
2.2 Combination of Proteus software and Keil uVision
For those who use Proteus software for the first time, they may not know how to set it up. Now the setting steps are briefly described as follows for reference only (this article only discusses the combination on a single machine. Due to space limitations, the use of two networked machines is not discussed here): The setting steps are as follows:
(1) Copy the VDM51.dll (C:ProgramFilesLabcenterElectronicsProteus6ProfessionalMODELS) file in the proteus installation directory to the C51BIN directory in the Keil installation directory; (2) Edit the tools.ini file in C51 and add: TDRV1=BINVDM51.DLL ("PROTEUS VSM MONITOR-51 DRIVER"); (3) Set in Keil uVision: project-->options forproject-->debug tab; (4) Select use proteus VSM monitor 51 (if you want to use two computers for simulation, double-click setting and enter the IP address or DNS name); (5) Load proteus file; (6) Select DEBUG-->use remote debug monitor in proteus; Enter KEIL's project menu option for target 'project name'. In the drop-down menu on the upper right column of the DEBUG option, select Proteus VSMMonitor-51 Driver. When entering setting, if the IP name of the same machine is 127.0.0.1, if it is not the same machine, fill in the IP address of the other machine. The port number must be 8000. Note: You can run keil on one machine and run proteus on another machine for remote simulation. (7) Open KEIL uVision and press F5 to start simulation.
2.3 Proteus working process
After running the ISIS program of proteus, enter the main interface of the simulation software. Before working, set the snap alignment under the view menu and the color, graphical interface size and other items under the system. Through the p (select component from library command) command in the toolbar, select the components required for the circuit in the pick devices window, place the components and adjust their relative positions, set component parameters, connect components, and write programs; under the Define code generation tools menu command in the source menu, select the tools, paths, extensions, and other items for program compilation; under the Add/remove source files command in the source menu, add the corresponding program of the microcontroller hardware circuit; and simulate the operation of the program and circuit through the corresponding commands in the debug menu. Proteus software provides more than 30 component libraries and thousands of components. The components involve digital and analog, AC and DC, etc.
2.4 Debugging methods provided by Proteus software
Proteus provides a relatively rich test signal for circuit testing. These test signals include analog signals and digital signals. For the debugging of microcontroller hardware circuits and software, Proteus provides two methods: one is the overall execution effect of the system, and the other is the step-by-step debugging of the software to see the specific execution status. For the debugging method of the overall execution effect, you only need to execute the execute menu item under the debug menu or the F12 shortcut key to start the execution, use the pause animation menu item under the debug menu or the pause key to pause the system operation; or use the stop animation menu item under the debug menu or the shift-break key combination to stop the system operation. The operation mode can also be selected by selecting the corresponding tool in the toolbar. For the step-by-step debugging of the software, you should first execute the start/restart debugging menu item command under the debug menu. At this time, you can select the stepover, step into and step out commands to execute the program (you can use the shortcut keys F10, F11 and ctrl+F11). The execution effect is single sentence execution, entering subroutine execution and jumping out of subroutine execution. After executing the start/restart debugging command, the software list involved in the simulation and the system resources of the microcontroller will appear below the debug menu, which can be analyzed and viewed during debugging.
2.5 Example of combining Proteus and KEIL uVision3 software
(1) Draw the schematic diagram through Proteus: (Figure 1)
(2)
Write a program in Keil uVision software:
#i nclude
#i nclude
void delayms(unsigned char ms) // Delay subroutine
{unsigned char i;
while(ms--)
{for(i = 0; i < 120; i++);}
}
main()
{unsigned char LED;
LED = 0xfe;
P0 = LED;
while(1)
{delayms(250);
LED = _crol_(LED,1);//Circularly shift right by 1 bit, light up the next LED
P0 = LED;
} }
(3) Setting of Proteus and Keil uVision software: (refer to 2.2 Combination of Protues software and Keil uVision) (4) Run the program, the running result is as follows (Figure 2): Realize the function of running lights
3. Summary
Proteus can not only be used as a simulation of school microcontroller (electronics, etc.) experiments, but also as a simulation experiment in personal studios. As students and engineering technicians majoring in electronic technology or control, after learning this software, you can make full use of the resources it provides to help yourself improve your engineering application ability. In teaching, using this software, in addition to teaching the specific course content of microcontrollers, you can also teach students the ability to apply this tool, laying a foundation for future work. Welcome to give your comments on this article. If you have any questions, please consult us.
Previous article:PROTEUS Design and Simulation of Single-Chip Microcomputer Application Products
Next article:Application and Design of SPCE061A Single Chip Microcomputer in Civil Engineering Thermometer
Recommended ReadingLatest update time:2024-11-16 17:38
- 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
- Have you ever used a fast charger using gallium nitride (GaN) technology?
- [HPM-DIY] HPM6750 peripheral LCDC driver RGB screen high frame rate video playback
- Xunwei IMX6 development board AndroidStudio-ledtest small light_test
- Help analyze this boost circuit
- Basic Concepts of Wireless Communication
- Download: Qorvo "Basics of Power Management"
- [National Technology N32G457 Review] 4. Serial port 2 DMA interrupt reception and transmission
- When a person gets an electric shock, is the current more harmful or the voltage more harmful?
- TMS320C6748 Development Board——EDMA
- Common Mistakes in MSP430 Programming