About STM32 tick-tick

Publisher:水云间梦Latest update time:2015-11-02 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
void SysTick_Configuration(void)

{
           
            if (SysTick_Config((SystemCoreClock) / 10))    //     1/10s=100ms
            {
                      
                     while (1);
            }

           NVIC_SetPriority(SysTick_IRQn, 0x0);
}

 

 The parameter of the SysTick_Config(SystemFrequency / 10)  function is the value of the systick reload timer.
The systck count frequency is 72000000 times per second, so 7200000 times is 1/10 second, which is 100ms.

SysTick is a 24-bit down counter. By setting the SysTick control and status register, you can select HCLK clock (72M) or HCLK divided by 8 (9M, the default) as the clock source of SysTick. The
reload register of SysTick determines the timer frequency.

 

If the clock source of SysTick is 72M,   SystemFrequency = 72000000Hz
, then SysTick_Config(SystemFrequency / 1000); is 1ms time base.
//     1/1000 s=1ms

Keywords:STM32 Reference address:About STM32 tick-tick

Previous article:STM32 V3.4 library function use to establish the project method
Next article:Reflection on STM32: Don’t be an irritable embedded engineer

Recommended ReadingLatest update time:2024-11-16 13:45

STM32 timer triggers ADC
Take the regular channel of STM32 ADC as an example (the injection channel is similar): As shown in the figure, the regular channel of STM32 ADC can be triggered by any of the above 6 signals. We use TIM2_CH2 to trigger ADC1, independent mode, and only measure one channel at a time. The configuration of ADC is as fo
[Microcontroller]
STM32 timer triggers ADC
STM32 NVIC preemption priority and response priority
The interrupt vector of STM32 has two attributes, one is the preemption attribute and the other is the response attribute. The smaller the attribute number, the higher its priority level. Preemption refers to the attribute of interrupting other interrupts. That is, because of this attribute, nested interrupts will occ
[Microcontroller]
STM32 interrupt configuration self-study summary
Simply record the interrupt configuration instructions of STM32! ----The first part is---interrupt vector table----- --------This is just a simple reference----Different versions are slightly different--but they are basically the same----You can search for it in the startup file---startup_stm32f10x_hd.s. ----Par
[Microcontroller]
STM32 interrupt configuration self-study summary
STM32 and passive buzzer
Using an active buzzer can only make a fixed "beep" sound, which is of course not enough. Using a passive buzzer, as long as you output PWM waves of different frequencies, you can make different notes. Different notes combined together form a song.           1.1     Musical scale     The musical scale is an essential
[Microcontroller]
STM32 and passive buzzer
The difference between PWM mode 1 and PWM mode 2 in stm32
PWM Mode 1 When counting up, once TIMx_CNT When counting down, once TIMx_CNT TIMx_CCR1, channel 1 is at an invalid level (OC1REF=0), otherwise it is at a valid level (OC1REF=1). PWM Mode 2 When counting up, once TIMx_CNT When counting down, once TIMx_CNT TIMx_CCR1, channel 1 is at a valid level, otherwise it is at an
[Microcontroller]
STM32 SysTick based on 3.5 library function
#include "stm32f10x.h" #include "led.h" #include stdio.h /*********************************************************************** ***********************************************************************/ static __IO uint32_t TimingDelay; /*********************************************************************** *
[Microcontroller]
How to use STM32 configuration to generate PWM
It is very convenient for STM32 to generate PWM. You only need to set the timer to generate it immediately! Of course, simple settings are also troublesome for novices, mainly including: (1) Enable the timer clock: RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); (2) Define the corresponding GPIO: /* PA2,3
[Microcontroller]
Using DMA to generate and capture square waves in STM32 microcontrollers
1 STM32 microcontroller Introduction The STM32 series microcontroller is a highly integrated microcontroller based on the Cortex-M3 core from ST. It sets a new benchmark in terms of performance, price, power consumption and real-time performance, integrating the Cortex-M3 core, as well as a rich
[Power Management]
Using DMA to generate and capture square waves in STM32 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号