问答

汇集网友智慧,解决技术难题

ar3000a

TA的家园币:157  

  • STM32F103RE的闹钟中断问题求教

    使用的是正点原子的例子,但是用的是LSI最为时钟源,但是一直复位,不懂为什么,有没有老哥解答一下的,main函数里面有一个打印,上电之后就是一直刷那个打印staticvoidRTC_NVIC_Config(void){NVIC_InitTypeDefNVIC_InitStructure;EXTI_InitTypeDefEXTI_InitStructure;NVIC_InitStructure.NVIC_IRQChannel=RTC_IRQn;//RTCÈ«¾ÖÖжÏNVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=2;//ÏÈÕ¼ÓÅÏȼ¶1λ,´ÓÓÅÏȼ¶3λNVIC_InitStructure.NVIC_IRQChannelSubPriority=2;//ÏÈÕ¼ÓÅÏȼ¶0λ,´ÓÓÅÏȼ¶4λNVIC_InitStructure.NVIC_IRQChannelCmd=ENABLE;//ʹÄܸÃͨµÀÖжÏNVIC_Init(&NVIC_InitStructure);//¸ù¾ÝNVIC_InitStructÖÐÖ¸¶¨µÄ²ÎÊý³õʼ»¯ÍâÉèNVIC¼Ä´æÆ÷NVIC_InitStructure.NVIC_IRQChannel=RTCAlarm_IRQn;NVIC_InitStructure.NVIC_IRQChannelCmd=ENABLE;NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=1;NVIC_InitStructure.NVIC_IRQChannelSubPriority=1;NVIC_Init(&NVIC_InitStructure);EXTI_ClearITPendingBit(EXTI_Line17);EXTI_InitStructure.EXTI_Mode=EXTI_Mode_Interrupt;EXTI_InitStructure.EXTI_Line=EXTI_Line17;EXTI_InitStructure.EXTI_Trigger=EXTI_Trigger_Rising;EXTI_InitStructure.EXTI_LineCmd=ENABLE;EXTI_Init(&EXTI_InitStructure);}//ʵʱʱÖÓÅäÖÃ//³õʼ»¯RTCʱÖÓ,ͬʱ¼ì²âʱÖÓÊÇ·ñ¹¤×÷Õý³£//BKP->DR1ÓÃÓÚ±£´æÊÇ·ñµÚÒ»´ÎÅäÖõÄÉèÖÃ//·µ»Ø0:Õý³£//ÆäËû:´íÎó´úÂëu8RTC_Init(void){//¼ì²éÊDz»ÊǵÚÒ»´ÎÅäÖÃʱÖÓu8temp=0;RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR|RCC_APB1Periph_BKP,ENABLE);//ʹÄÜPWRºÍBKPÍâÉèʱÖÓPWR_BackupAccessCmd(ENA

    STM32F103 tc RTC TI ic ni

    2022-01-09 1