RTC, Real Time Clock

 

 configure

When writing the RTC_PRL, RTC_CNT, RTC_ALR registers, you need to enter the configuration mode first, by setting the CNF bit of the RTC_CRL register to one.

In addition, each time you configure a register, you must wait for the previous configuration to complete. You can check whether the RTOFF bit in RTC_CRL is 1, and you need to wait until it is 1 before you can perform the next configuration.

Configuration steps:

  1. Loop through RTOFF until it is 1.
  2. Set CNF to enter configuration mode.
  3. Configure the registers that need to be configured.
  4. Clear the CNF bit to exit configuration mode.
  5. Loop through RTOFF until it is 1 to determine successful configuration.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324780820&siteId=291194637