Qinheng CH55X online simulation method description - using ISD51 for online simulation
[Copy link]
This post was last edited by qwqwqw2088 on 2021-6-22 09:35
This article mainly introduces the simulation method of CH55x microcontroller using ISD51 and gives simple operation routines.
advantage
No hardware circuit requirements are required;
It can be present in the final product and ISD51 is free to use;
The serial port can continue to be used for communication, or printf() for debugging.
shortcoming
Using software breakpoints, the program runs relatively slowly;
If other interrupt priorities are the same as or higher than the ISD51 system interrupt priority, the system cannot set breakpoints or single-step execution. The default state of the ISD51 interrupt function priority is 0.
ISD51 can only take effect when both ISD51 interrupt and global interrupt are turned on. In this way, ISD51 can also be stopped while the program is running.
Support functions
Basic hardware debugging functions are supported, such as variable monitoring, setting breakpoints, etc.
How to use
1. Add ISD51.A51 and ISD51.H to the project;
2. Initialize the serial port, configure the appropriate baud rate, and finally enable the global interrupt;
3. Select the appropriate ISD51 initialization function;
ISDinit(): Initialize and run the user program. If KEIL successfully communicates with the microcontroller, the program will terminate immediately.
ISDwait(): Initialize ISD51 and wait for KEIL to connect
ISDcheck(): Periodically check the ISD51 connection
4. Compile the user program and burn it into the microcontroller;
5. Select ISD51 In-system Debugger in KEIL -> option for target -> DEBUG setting, and set the serial port baud rate corresponding to the ISD51 serial port initialization in setup.
6. Click the DEBUG button to enter hardware debugging mode.
The ISD51 interface functions can be found in the KEIL help documentation.
Figure 1 ISD51 configuration settings
The baud rate and COM port can be set as needed. Since IDS51 is a dynamically configured connection, the ISD51 Identification information can be ignored.
Troubleshooting:
1: The KEIL serial port settings do not match the MCU serial port settings, such as serial port number, baud rate and other information.
2: The microcontroller can only use serial port 0 for online simulation and cannot use other serial ports.
During simulation, you can first test whether the serial port is normal. First use the serial port debugging tool to send 0XA5. When the MCU runs the DEBUG program normally, it will respond with 0xF7, 0xFF, 0x00, 0x00, 0x09, 0x19, 0xAC. If you receive the code shown above, it means that the ISD setting is normal.
3. You must first burn the hex file with ISD51 to the microcontroller before you can perform hardware simulation
CH55X在线仿真方法说明——使用ISD51进行在线仿真.rar
(159.06 KB, downloads: 10)
|