51 microcontroller simulation chip debugging

Publisher:Bby1978Latest update time:2023-01-30 Source: zhihu Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Experimental environment : Keil software, version: C51 V9.54

STC-ISP comprehensive download software, version: V6.88

Simulation chip : IAP15W4K58S4

51 microcontroller online simulation environment construction

Step 1: Add the header files and simulation driver files of the STC microcontroller to the Keil software, and click Prepare to add;

Add STC microcontroller simulation file

Step 2: Select the installation location of the Keil software. Most of us have installed the Keil software for developing STM32. Remember to add it to the 51 microcontroller development environment folder, and then click "OK".

Select installation directory

After adding, a dialog box will pop up indicating that the addition was successful.

Add success dialog

Step 3: Open the Keil software to create a new project and check whether the addition is successful. When you create a new project, you can see "STC MCU Database"

There is STC microcontroller option

After selecting Database, you can see many STC microcontroller models.

STC microcontroller model

What I am using here is the IAP15W4K58S4 chip from Hongjing Company . Select the chip and click " OK "

Simulation environment settings

Step 1: Find the " Options for TARGET... " option and click

Step 2: Find the “ Debug ” option in the pop-up dialog box and select the “ STC Monitor 51 Driver ” option.

Select the good effect and click " OK "

Step 3: Click " Settings " to set the simulation port of the microcontroller

In the pop-up dialog box, select the USB-to-serial port. The port here is COM20 (choose according to your own serial port situation) , and the baud rate is 115200 (other baud rates are also available, you can choose according to your own situation), and set it up Then click the "OK" option

In this way, we have set up the development environment

Write code verification

Here we first use a program to turn on and off the LED light to test it.

First download it in the normal way and see the effect.

animated cover

Before debugging, we should first perform a small operation on the simulated microcontroller, that is, download a monitoring program provided by ST Hongjing Company. Each of our STM32 microcontrollers comes with its own monitoring program. In the "STC-ISP" software Find "Keil Simulation Settings", then select our microcontroller model and click " Set the selected target microcontroller to the simulation chip "

animated cover

In the Keil software simulation, we first set a breakpoint in the while loop. Since the communication speed of the serial port is not high, the simulation will easily crash if the delay time is too long. I will change the delay to 1ms here. You can try to change the serial port communication Try increasing the speed

Online simulation debugging effect

animated cover

Summarize:

1. Simulation is a very important skill in the microcontroller learning process and project development process. It is said in the industry that the program is adjusted

2. Hongjing Company’s simulation microcontroller uses serial port simulation, so there are limitations on the data return speed. This requires some skills. Later, I will also introduce you to using proteus for online debugging and introduce some simulation skills, so please expect


Reference address:51 microcontroller simulation chip debugging

Previous article:Can microcontroller debugging still be played like this? Keil and Proteus achieve perfect joint debugging of 51 microcontroller
Next article:Alternative entry methods and programming ideas for 51 microcontrollers

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号