Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
750 views
in Technique[技术] by (71.8m points)

stm32 - 即使启用了TICKINT,也无法触发Systick中断处理程序。 为什么?(Unable to trigger Systick Interrupt Handler even after enabling TICKINT. Why?)

    #include "stm32f10x.h"
    #define PIN_PC13     0x2000
    #define ON_BOARD_LED  PIN_PC13
    void LED_Init(void);

    int main()
    {

Function for Initialising on board LED of STM32F103C8T6

(STM32F103C8T6板上LED初始化功能)

    LED_Init();  
    while(1)

    {

    }

    return 0;

    }

    void LED_Init()
    {

APB bus-2 clock enable ---> Enabled in order to use the peripheral

(APB总线2时钟启用--->为了使用外设而启用)

    RCC->APB2ENR |= RCC_APB2ENR_IOPCEN; 

    GPIOC->CRH |=GPIO_CRH_MODE13;   

    GPIOC->CRH &= ~(GPIO_CRH_CNF13);

    SysTick_Config(800000-1);   

    //SysTick->CTRL |=0x07;

   //SysTick->LOAD =8000000/10 -1;

    }

Interrupt handler not running why?

(中断处理程序为什么不运行?)

    void SysTick_Handler(void)

    {
        GPIOC->ODR ^=ON_BOARD_LED;  // Toggling the on board LED
    }
  ask by Devanshu Tripathi translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

您还需要在NVIC控制器中启用它。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...