cancel
Showing results for 
Search instead for 
Did you mean: 

RTC accuracy under LPWFI ??

shinnlin
Associate II
Posted on October 24, 2005 at 05:46

RTC accuracy under LPWFI ??

13 REPLIES 13
anis2
Associate II
Posted on March 04, 2005 at 13:33

Hi Shinn,

Please try this software.

Best regards

Prog 8-)

________________

Attachments :

rtc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtKr&d=%2Fa%2F0X0000000aLg%2FlPnRAnKDzAetEregJdTLcKSY5t2DgN120jvMJfHjjUo&asPdf=false
shinnlin
Associate II
Posted on March 07, 2005 at 00:21

Thank you, Bouha !

I'd tried your code.

It works because you just enter WFI for once.

Try this one: add PCU_WFIEnter() in infinite while loop in main().

Now the RTC wake-up frequency becomes 200Hz, not 1kHz...

while (1)

PCU_WFIEnter( WFI_EXTERNAL, ENABLE, ENABLE);

So.... Still have problem on RTC Interrupt in WFI mode !! :(

pchignon
Associate II
Posted on October 07, 2005 at 08:08

I am doing the same kind of test but with the alarm interrupt.

When I enter LPWFI mode I cannot catch the RTC IT.

I don't test with the Second Interrupt but with the alarm It doesn't work.

Is there a solution? I test with the XTI line 15 interruption and it works! But why ?

Here is some explaination

If I simulated LPWFI that way :

#if 1

int i=0;

while(i

AsystTrace(''> %d %d\n'', RTC->CNTL, _n_step); // _n_step the alarm timer

i++;

for (int j=0;j

}

#else

PCU_WFIEnter(WFI_EXTERNAL,ENABLE,ENABLE);

#endif

If I use:

RCCU_RCLKSourceConfig(RCCU_RTC_CLOCK);

Not IT catch and I see :

> 1016 3328

> 1016 3328

> 1016 3328

> 1016 3328

> 1016 3328

with

RCCU_RCLKSourceConfig(RCCU_CLOCK2_16);

Interrupt is caught and I see

> 1010 3328

> 1261 3328

> 1511 3328

> 1759 3328

> 2012 3328

> 2263 3328

> 2511 3328

> 2764 3328

> 3017 3328

> 3265 3328

Haaaaa!

> 3346 3328

> 3362 3328

> 3382 3328

> 3399 3328

> 3419 3328

> 3440 3328

> 3460 3328

> 3480 3328

> 3501 3328

> 3517 3328

And the RTC_Handler

__arm void RTC_IRQHandler(void)

{

...

if ( RTC_FlagStatus ( RTC_AIR ) == SET )

{

RCCU_RCLKSourceConfig(RCCU_CLOCK2); // To enable the bus between RTC and APB RTC *4 < CORE

AsystTrace(''Haaaaa!\n'');

RTC_FlagClear ( RTC_AIR );

RTC_FlagClear ( RTC_GIR );

}

...

}

pchignon
Associate II
Posted on October 24, 2005 at 05:46

Hello,

I noticed that :

To be caught, the RTC component must be scheduled by

RCCU_PCLKConfig(RCCU_DEFAULT);. If not, the RTC Alarm IT cannot be caught surely.

is that true ?

Ludo