STM32F103 RTC calibration issue
Hi,
I'm trying to calibrate my RTC by writing on the RTCCR register on an STM32F103 MCU. However, it seems like this is not taken into account as the 512Hz signal is still slightly out.
I'm using the following code:
PWR-> CR |= PWR_CR_DBP; // Allow access to the Backup area
BKP-> RTCCR = 120; // calibrate RTC
AFIO->EVCR =0xAD; //PC13-calibration clock output enable
BKP->RTCCR &= ~BKP_RTCCR_ASOE;
BKP->RTCCR &= ~BKP_RTCCR_ASOS;
BKP->RTCCR |= BKP_RTCCR_CCO; //Setting this bit outputs the
PWR-> CR &=~ PWR_CR_DBP; // deny access to the Backup area
I'm using the MBED framework so I was wondering if something was messing with the RTC but I tried with STM32CubeIDE with nothing activated and it's still not doing anything.
Any idea? Am I missing something?
Louis
