2005-10-23 08:46 PM
2005-03-02 06:23 PM
2005-03-02 10:35 PM
Hello Shinn,
I come just to test our RTC and you find attached an example when the RTC generate an interrupt every 1ms. Hope that this can help you, Don't hesitate for any clarification. With regards, Hich [ This message was edited by: Hich on 03-03-2005 12:08 ] ________________ Attachments : rtc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I13K&d=%2Fa%2F0X0000000bmF%2FSpT1WWIZtQHV17SGxK83wZQ9_CwBgGHzVVFlRnb9g78&asPdf=false2005-03-03 01:31 PM
Thank you, Hich.
I can get an accurate 1ms RTC interrupt under RUN mode. However, no way to get RTC accurate in LPWFI mode with CK_AF. There seems a limitation that RTC external clock should be at least 4 times smaller than PCLK2. So, it seems that accurate RTC under LPWFI with CK_AF clock is mission impossible since PCLK2 is equal or smaller than RTC clock in this situation... Any solution ???? Btw, if I wanna get an 1/1024 sec interrupt on 32768Hz RTC clock, which prescaler value should I use ? 32 or 31 ? Thanks !! [ This message was edited by: Shinn on 04-03-2005 03:05 ]2005-03-04 02:07 AM
Hi Shinn,
Here is the explanation for your problem: - The RTC interrupt exits the MCU from LPWFI mode (32KHz) to RUN mode and when exiting from LPWFI, the system clock (RCLK) will be kept 32KHz. In the RTC interrupt routine, you are clearing the RTC interrupt flags, but with the 32KHz as system clock these flags will be not cleared.this because the RTC registers will need PCLK > 4 times the RTC clock (32KHz) to be accessed. So the solution for your case is to return to the PLL clock before clearing the RTC flags: RCCU_RCLKSourceConfig(RCCU_PLL1_OutPut); Best regards. :p :p2005-03-04 02:20 AM
2005-03-04 02:49 AM
hi Shinn,
You should return to the PLL clock when entering in the RTC interrupt routine. Because when entering in the LPWFI mode the system clock will change to 32KHz and will remain 32KHz after exit. Regards, Hich ;)2005-03-04 03:03 AM
2005-03-04 03:19 AM
Shinn,
You have to include the line: ''RCCU_RCLKSourceConfig( RCCU_CLOCK2);'' just in the beginning of the RTC interrupt routine not before. Regards :D2005-03-04 03:56 AM