Detailed steps for debugging delay time of keil software

Publisher:创新脑细胞Latest update time:2018-12-14 Source: eefocusKeywords:keil Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Methods/Steps


  1. mS level delay subroutine with parameters

    void delay_ms(uint z) //delay subroutine

    {

       uint x,y;

       for(x=z;x>0;x--)

       for(y=110;y>0;y--);

    }


  2. The software debugging process of the above program! The crystal oscillator is 12M


  3. Step 1: Select the microcontroller crystal


  4. Detailed steps for debugging delay time of keil software



  5. Step 2: Full Compilation


  6. Detailed steps for debugging delay time of keil software


  7. Step 3: Press d to enter software debugging


  8. Detailed steps for debugging delay time of keil software


  9. Step 4: Enter the program and set two breakpoints:


  10. Detailed steps for debugging delay time of keil software


  11. Step 5: Run at full speed to the first breakpoint: Note that the time is 0.000389s


  12. Detailed steps for debugging delay time of keil software


  13. Step 6: Press the button again to run at full speed to the second breakpoint: Note that the time is 1.013412s


  14. Detailed steps for debugging delay time of keil software



  15. Summary: The time difference between the two is about 1s, which is the time to execute delay_ms(1000)


Keywords:keil Reference address:Detailed steps for debugging delay time of keil software

Previous article:Summary of Microcontroller Knowledge
Next article:About the sprintf() function crash in Keil

Recommended ReadingLatest update time:2024-11-16 14:54

Using Keil C51 to develop serial port
The serial port of the MCS-51 microcontroller has two independent data lines - the transmitting end TXD and the receiving end RXD, which allows data to be transmitted in two opposite directions at the same time. In general, during communication, the sending data is output from the TXD end and the receiving data is inpu
[Microcontroller]
KEIL MCU RAM out of range processing
I wrote a test program before. When I wanted to improve the test program last night, I found that I added an extra global variable unsigned int flag; //define a global variable and burn it into the microcontroller. When the microcontroller is running, the LCD display is normal. The measured data cannot be displayed. A
[Microcontroller]
Keil mode settings and programming matters
One of the keys to learning C51 is to deeply understand and apply C51's extensions to standard ANSI C. This is because most of the extensions are directly targeted at the 8051 series CPU hardware. There are roughly 8 categories: 8051 storage types and storage areas, storage modes, memory type declaration, varia
[Industrial Control]
Keil warning and error statements and elimination methods notes
Keil related errors encountered, warning content is updated here Warning: #1-D: last line of file ends without a newline Solution: Make sure there is no symbol in the last line of the file.  #167-D: argument of type "x" is incompatible with parameter of type "xxx" Solution: The reason why there are so many w
[Microcontroller]
Running errors of stm32f103 and some changes of keil5
During the debugging of STM32F103ZET6, I wrote the Systick tick configuration and interrupt function, and there was no error after compiling. I couldn't wait to download the program to the board, and the running light did not flicker. I carefully checked the program and found no problems with the pin configuration, pe
[Microcontroller]
Use keil to burn stm32 and pay attention to changing the address
  Pay attention to modifying the RAM and ROM addresses along the way, especially when setting up IAP.
[Microcontroller]
Use keil to burn stm32 and pay attention to changing the address
Keil C51's 11th keyword extension of C language: xdata
The variable declared by xdata is located somewhere within the 64KB address range of external RAM. Program example: unsigned int xdata m=0; /* declare a global variable, which can be located anywhere within the 64KB address range of the external RAM, determined by the compiler*/ int main(void) { ...... }
[Microcontroller]
Related settings for simulation download using Keil C51
Note: To compile or simulate a project, you must first install the Keil software and the corresponding Silicon IDE driver software. Keil installation:   Please go to Keil official website:  https://www.keil.com/c51/demo/eval/c51.htm to download and install. · Keil μVision Driver installation:   Please go to the Silabs
[Microcontroller]
Related settings for simulation download using Keil C51
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号