In addition to writing, compiling and simulating execution to debug user programs, Keil can also implement online debugging through the serial port, that is, to see the execution effect of the code on the hardware through single step and breakpoint. The steps are as follows:
The AT89C51CC03 microcontroller is used, and the keil version is Keil C51 V9.00.
1. Use KEIL to create project files, program, compile and debug user programs to ensure that there are no problems in software execution.
2. Modify the configuration file config.inc in the keil/c51/FlashMon directory of the KEIL installation point that is consistent with the microcontroller model. Mainly modify the two parameter values of cpu_clock and code_start according to the actual situation. I changed them to 12M and 0E000H.
3. Recompile the programs in this directory and generate a new debugging program Monitor.HEX. If it is not regenerated, check the option create HEX file.
4. Run the FLIP program and burn Monitor.HEX into the MCU. The starting address is 0E000H, that is, SBV=E0, BLJB is selected, BSB=0, EB=FF
5. Click the Start Application button to execute the Monitor.HEX program
6. Run Keil, open the project file, modify the debugging parameters, that is, menu project-->option for target, select debug page, click use Keil monitor 51 driver on the right, click the setting button, select the serial port and baud rate, note that it should be consistent with the baud rate used when burning the chip, generally 9600. It should be noted that if the serial port is in automatic mode (that is, in addition to the three communication lines, RTS and DTR are also connected), RTS and DTR need to be set to inactive.
7. After compiling the program, click the debug command under the debug menu. You can execute it step by step, set breakpoints, and run it at full speed. At this time, you can actually use the microcontroller hardware to run the program and see the execution effect, such as display, key response, etc. In this case, you can debug the actual execution effect of the program.
8. If you do not set breakpoints and run the user program at full speed, the user program will be consistent with the actual operation, Keil will lose control of the user program and will not be able to interrupt the execution of the user program (only pressing reset can interrupt the user program)
9. If you find a problem, you can exit the debugging state, modify the program, recompile, and then enter the debugging state again, and debug by single-step or setting breakpoints. Note that you cannot interrupt when running at full speed, otherwise you will not be able to exit (the consequence of forced exit is that the monitor state is incorrect and you cannot enter the online debugging state again).
10. After exiting debugging, the monitor program cannot be executed again, whether you press reset or flip the program's start application button. At this time, the user program is executed. If you want to continue debugging, you can only erase the flash and burn the monitor into the microcontroller again.
Previous article:STM32 RAM download online debugging settings
Next article:STM32 sets the DEBUG start address in keil
Recommended ReadingLatest update time:2024-11-23 02:59
- 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)
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- USART module program implementation of MSP microcontroller
- One picture lets you understand TE's various industrial motor sensors
- [Project Source Code] How to forcefully delete the device driver when a device driver conflict causes a blue screen
- A beginner is asking for help. The source code of two different LPC1768 chips, the QEIPOS register is not used
- ucosii porting code on TMS320LF2407A processor
- I2C Controlled 6A Three-Level Switch-Mode Single Cell Battery Charger
- Sipeed LicheeRV 86 Panel Review】6- Review Summary
- FPGA Experiment (III) VGA Color Bar Signal Display Based on HDL Language
- The key to the warehouse was found, and the music phone from 15 years ago was unboxed!
- Application of OPT3004 in battery-powered cameras