2017-08-20 10:15 AM
Hi every one
I want update the programmable alarm in stm32f4 series .
according to reference manual :
Programming the alarmA similar procedure must be followed to program or update the programmable alarm (AlarmA or Alarm B):1. Clear ALRAE or ALRBIE in RTC_CR to disable Alarm A or Alarm B.2. Poll ALRAWF or ALRBWF in RTC_ISR until it is set to make sure the access to alarmregisters is allowed. This takes 1 to 2 RTCCLK clock cycles (due to clocksynchronization).3. Program the Alarm A or Alarm B registers (RTC_ALRMASSR/RTC_ALRMAR orRTC_ALRMBSSR/RTC_ALRMBR).4. Set ALRAE or ALRBIE in the RTC_CR register to enable Alarm A or Alarm B again.Note: Each change of the RTC_CR register is taken into account after 1 to 2 RTCCLK clock cyclesdue to clock synchronization.problem is here that RTC_CR values do not change .
so I can not update the alarm .
please help me .
thank you.
#programable #alarm #rtc #update-alarm #alarm-b #alarm-a2017-08-20 11:40 AM
Do you unlock the RTC?
/* Enable the PWR clock */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);/* Allow access to RTC */
PWR_BackupAccessCmd(ENABLE);2017-08-21 01:42 AM
yes
i unlock the RTC register.and now i can write new and update value to RTC register.
now my question is that
How can i lock the RTC register?
thank you
2017-08-21 05:42 AM
Use the DISABLE parameter?
2017-08-21 09:20 AM
i should write RTC->WPR=0xFF;
it is ok.
2017-08-21 10:21 AM
Or clear the DBP bit in PWR->CR ?
2017-09-03 02:50 AM
My problem has been resolved
thank you