AnsweredAssumed Answered

Problem accessing RTC->PRLx

Question asked by ather.m on Jul 25, 2011
Latest reply on Jul 25, 2011 by cerdan.irvin_jasper
Hi All,

I am trying to change RTC->PRLH and RTC->PRLL.

The second WHILE hangs.

I keep re-reading the same paragraph in the STM32F101xx reference manual (UM0306, CH8), but I can't see what I am doing wrong. 

Preceding code has enabled APB1 at much more than 4x 32kHz.

Commenting out the second WHILE and reading RTC->PRLL later confirms that it has been set as expected.

Thoughts please.

-Mark


while((RTC->CRL & RTC_CRL_RTOFF) ==0);
RTC->CRL |=RTC_CRL_CNF;
RTC->PRLH =0;
RTC->PRLL =0x7FFF;
RTC->CRL &=~RTC_CRL_CNF;
while((RTC->CRL & RTC_CRL_RTOFF) == 0);

Outcomes