Document directory
-
- 4. Create a simulation Chip
- 5. Start Simulation
STC monitor51 simulator User Guide
1. Install the simulation driver of the Keil version.
2. Create a project in Keil
3. Set the project and select the STC simulation driver.
4. Create a simulation Chip
5. Start Simulation
1. Install the simulation driver of the Keil version
For example, on the "Keil Association Settings" page, click "add MCU model to Keil". In the following directory selection window, locate the installation directory of Keil (generally "C: \ Keil \") and "OK"
If the following prompt box appears, the installation is successful.
2. Create a project in Keil
If the driver in step 1 is successfully installed, the "stc mcu Database" option is displayed when you select the chip model when creating a project in Keil.
Then select the responding MCU model from the List (currently, only stc15f2k60s2 is supported for simulation by STC). Therefore, select the "stc15f2k60s2" model and click "OK" to complete the selection.
Add source code files to the project, for example:
Save the project. If the compilation is correct, you can set the following project.
3. Set the project and select the STC simulation driver.
For example, first go to the Project Settings page, select the "debug" Settings page, and select "use…" on the right of the hardware simulation in step 1 ...", Step 2: Select the "STC Monitor-51 driver" item from the simulation driver drop-down list, and click the "Settings" button to go to the settings screen below, set the port number and baud rate of the serial port. Generally, set the baud rate to 115200 or 57600. This setting is complete.
4. Create a simulation Chip
Prepare an iap15f2k61s2 or iap15l2k61s2 chip and connect it to the serial port of the computer through the download Board. For example, select the correct chip model and go to the "Keil Association Settings" page, select "single CPU solution", select "independent solution (no serial port or timer occupied)", and click "download/Program" in the lower left corner, after the program is downloaded, the simulator is created.
5. Start Simulation
Connect the produced simulation chip to the computer through the serial port.
After compiling the project we created earlier to no error, press Ctrl + F5 to start debugging.
If the hardware connection is correct, the following debugging interface will be displayed.
Currently, the maximum number of breakpoint settings is 20 (theoretically, you can set any number, but too many breakpoint settings will affect the debugging speed ).