cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f100 nonperiod wake up from RTC

FLast.11
Associate III
Posted on October 11, 2016 at 06:09

i follow the example of stdPeriph_driver of stm32f10x

to set the mcu in low power standby mode and was (only allow?) to wake up(periodly wake up) and sleep in same period, says 100ms wake up and 100ms sleep( i measure the current by meter)

I wonder is it possible to set say 900ms sleep and 100ms wakeup time?

thanks

Jeff

#sleep-wakeup
1 REPLY 1
Walid FTITI_O
Senior II
Posted on October 11, 2016 at 15:34

Hiyu.jeff.001,

Yes you can do that. You configure the desired RTC period by configuring the right prescaler. The prescaler is RTC period = RTCCLK/(RTC_PSC+1) For LSE clock source : RTCCLK = 32,768 KHz So for RTC period = 100ms =0,1 s -> RTC_PSC= (32768/0,1)-1 = 327679 As mentioned in reference manual RM0041 (p 453) the prescaler division factor is up to 10485 So we are in the range. Now in the RTC configuration code you put thi value , the device will remain 100ms in standby mode.

/* Set RTC prescaler: set RTC period to 100 msec */
RTC_SetPrescaler(327679);

For the period after wakeup , I recommend to manage that with systick delay. So you can have a look to systick example in the library. -Hannibal-