Question: stm32 SysTick_Handler() usage

Publisher:MysticalGlowLatest update time:2018-07-20 Source: eefocusKeywords:stm32  SysTick_Handler() Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I am using stm32f100, and when debugging SysTick_Handler(), I use the following configuration

if (SysTick_Config(SystemCoreClock / 1000))
  { 
    /* Capture error */ 
    while (1);
  } 周期为1ms,

/*******************************************************
**Function: Delay() delay function
**Input: TimeI, TimeI ms;
************************************************************/
void Delay(u32 TimeI)
{
u32 TimeJ;
TimeNum = TimeI;
while(TimeNum);
}
/*******************************************************
**Function: DelayCount() counting function, put it into the tick interrupt to decrement
**Input: None
**********************************************************/
void DelayCount(void)
{
if(TimeNum)TimeNum--; 
}

void SysTick_Handler(void)
{
while(TimeNum);
}

Call Delay(10); and find that it keeps getting stuck in while(TimeNum);. When debugging, I see that the TimeNum value keeps decreasing. I really don’t understand. . . .


Keywords:stm32  SysTick_Handler() Reference address:Question: stm32 SysTick_Handler() usage

Previous article:Thoughts on the Implementation of Systick Interrupt Function SysTick_Handler
Next article:STM32 system learning-SysTick (system timer)

Recommended ReadingLatest update time:2024-11-16 19:43

stm32 j-link offline operation settings after burning under IAR
1、 projectEWARMv4lnkarm_flash.xcl // Code memory in FLASH -DROMSTART=0x8008000 -DROMEND=0x8014fff   change to // Code memory in FLASH -DROMSTART=0x8000000 -DROMEND=0x8014fff   2、 #define NVIC_VectTab_RAM                         ((u32)0x20000000) #define NVIC_VectTab_FLASH                     ((u32)0
[Microcontroller]
The first new product, Mier STM32MP2 core board is launched! High performance + multiple interfaces + edge computing power
Mir released the MYC-LD25X core board and development board based on the STM32MP257 embedded processor module. The core board is based on the STM32MP2 series, which is the latest generation of industrial-grade 64-bit microprocessors launched by STMicroelectronics. It adopts LGA 252 PIN design, storage configuration
[Embedded]
The first new product, Mier STM32MP2 core board is launched! High performance + multiple interfaces + edge computing power
Use J-link+J-Flash to burn the serial number to the STM32 chip
    In a recent project, a serial number needs to be burned into the STM32 chip, which is a problem encountered in mass production of products.     Hardware preparation: a J-Link, a STM32F103C8T6 development board     Software preparation: J-Flash of Setup_JLink_V600d version  In the early stage of creating a new proj
[Microcontroller]
[STM32 motor vector control] Record 7 - Setting of six-sector output values
The calculation method of the six states of the sector is as follows: N=4*C+2*B+A   The corresponding relationship between N value and sector:   Basic vector action time calculation and three-phase PWM waveform synthesis  The value of the PWM cycle counter is NTpwm=fdsp/fs/2 Wave coefficient: Unom is the system r
[Microcontroller]
[STM32 motor vector control] Record 7 - Setting of six-sector output values
Design and implementation of infrared thermometer based on STM32
Infrared thermometer is a new type of temperature measuring instrument that combines infrared technology with microelectronics technology. Compared with traditional contact temperature measuring instruments, it has a series of advantages such as high temperature measurement accuracy, non-contact, no influence on the te
[Microcontroller]
Design and implementation of infrared thermometer based on STM32
STM32 common download methods
1. Download the program through the serial port The steps for downloading the program through the serial port are as follows: 1) Connect the power cord and the serial port cable 2) When the power is off, connect the BOOT0 power supply (3.3V) to a high level. Reason: The boot area of ​​STM32 can be set through the two
[Microcontroller]
STM32 study notes USB data receiving and sending process analysis
Now that you have learned USB, you must understand how USB devices communicate with USB host data. Here we mainly talk about the device side, because our code is used for USB devices. We need to define the USB interrupt. First, in the interrupt vector table of STM32, two interrupts are given to USB. We can find these
[Microcontroller]
Design of intelligent control network terminal based on STM32 embedded system
Intelligent network terminal is an embedded terminal device that realizes intelligent management. It usually has the basic functions of security access control system and automatic control. This article focuses on the design and implementation of the network control function of intelligent embedded terminal based on
[Microcontroller]
Design of intelligent control network terminal based on STM32 embedded system
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号