Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
320
/
631
Calibration clock output
When RTC_CTRL.COEN set to 1, PC13 pin will output calibration clock. If RTC_CTRL.CALOSEL=0 and
RTC_PRE.DIVA[6:0] = 0x7F, the RTC_CALIB frequency results is f
RTCCLK
/RTC_PRE.DIVA[6:0]. This is equivalent
to a calibration output of 256 Hz when the RTCCLK frequency is 32.768 kHz. The rising edge is recommended for
there is slight jitter on the falling edge.
When RTC_CTRL.CALOSEL=1 and "RTC_PRE.DIVS[14:0]+1" is a non-zero integer multiple of 256, the
RTC_CALIB frequency is given by the formula f
RTCCLK
/(256 * (DIVA+1)). This is equivalent to 1Hz calibration
output when the RTCCLK frequency is 32.768 kHz and RTC_PRE.DIVA[6:0] = 0x7F.
Note: When the RTC_CALIB or RTC_ALARM output is selected, the RTC_OUT pin (PC13) is automatically
configured as output.
Programmable Alarm
RTC has 2 programmable alarms: Alarm A and Alarm B.
TC alarm can be enabled or disable by RTC_CTRL.ALxEN bit. If the alarm value match the calendar values, the
RTC_INITSTS.ALxF flag will be set 1. Each calendar field can be selected to trigger alarm interrupt if
RTC_CTRL.ALxIEN bit is enabled.
Alarm output: Alarm A and Alarm B can be mapped to RTC_ALxRM output when RTC_CTRL.OUTSEL[1:0] is
selected, and output polarity can be configured by RTC_CTRL.OPOL bit.
Note: If the second field is selected (RTC_ALARMx.MASK1 bit reset), RTC_PRE.DIVS[14:0] must be larger than
3 to ensure correct operation.
Alarm configuration
Alarm A and Alarm B should be configured in the following below:
Disable Alarm A/Alarm B by clearing RTC_CTRL.ALAEN/RTC_CTRL.ALBEN bit.
Configure the Alarm x registers (RTC_ALRMxSS/RTC_ALARMx)
Enable Alarm A/Alarm B interrupt by set RTC_CTRL.ALAIEN/RTC_CTRL.ALBIEN bit(this step can be
selected as needed )
Enable Alarm A/Alarm B by setting RTC_CTRL.ALAEN/ RTC_CTRL.ALBEN bit.
Alarm output
When RTC_CTRL.OUTSEL[1:0] !=0, RTC_ALARM alternate function output is enable. There are Alarm A output,
Alarm B output and Wakeup output to choose by the value of RTC_CTRL.OUTSEL[1:0] bits.
RTC_CTRL.OPOL bit control the polarity of the Alarm A, Alarm B or Wakeup output.
RTC_OPT.TYPE bit control the RTC_ALARM pin to output open drain or output pull-up.