CH32V203 RTC讀取出來(lái)的數(shù)據(jù)全部為0
- 使用的例程:CH32F20xEVT\EVT\EXAM\RTC
修改了RTC時(shí)鐘為內(nèi)部時(shí)鐘源:
u8?RTC_Init(void) { ????u8?temp?=?0; ????RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR?|?RCC_APB1Periph_BKP,?ENABLE); ????PWR_BackupAccessCmd(ENABLE); ????/*?Is?it?the?first?configuration?*/ ????BKP_DeInit(); ????RCC_LSEConfig(RCC_LSE_ON); ????while(RCC_GetFlagStatus(RCC_FLAG_LSERDY)?==?RESET?&&?temp?<?250) ????{ ????????temp++; ????????Delay_Ms(20); ????} ????if(temp?>=?250) ????{ ????????return?1; ????} ?????RCC_RTCCLKConfig(?RCC_RTCCLKSource_LSI?);//僅修改了此處 ?????RCC_RTCCLKCmd(?ENABLE?); ?????RTC_WaitForLastTask(); ?????RTC_WaitForSynchro(); ?????// RTC_ITConfig(RTC_IT_ALR,?ENABLE); ?????RTC_ITConfig(?RTC_IT_SEC,?ENABLE?); ?????RTC_WaitForLastTask(); ?????RTC_EnterConfigMode(); RTC_SetPrescaler(?40000?); //?????RTC_SetPrescaler(?32767?); ?????RTC_WaitForLastTask(); ?????RTC_Set(?2023,?4,?25,?16,?58,?55?);???????/*?Setup?Time?*/ ?????RTC_ExitConfigMode(); ?????BKP_WriteBackupRegister(?BKP_DR1,?0XA1A1?); ????RTC_NVIC_Config(); ????RTC_Get(); ????return?0; }
- 使用MounRiver Studio編譯的固件燒錄后,連串口都無(wú)法打印。
這個(gè)論壇html頁(yè)面,能不能做好一點(diǎn),發(fā)個(gè)問(wèn)題,貼個(gè)代碼發(fā)出來(lái)就是亂碼,編輯了N次。