Skip to main content
Visitor II
October 24, 2005
Question

RTC accuracy under LPWFI ??

  • October 24, 2005
  • 13 replies
  • 2220 views
Posted on October 24, 2005 at 05:46

RTC accuracy under LPWFI ??

    This topic has been closed for replies.

    13 replies

    shinnlinAuthor
    Visitor II
    March 6, 2005
    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 !! :(

    Visitor II
    October 7, 2005
    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 );

    }

    ...

    }

    Visitor II
    October 24, 2005
    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