Skip to main content
Visitor II
September 18, 2007
Question

RTC ,always 0 !!!!

  • September 18, 2007
  • 2 replies
  • 852 views
Posted on September 18, 2007 at 05:49

RTC ,always 0 !!!!

    This topic has been closed for replies.

    2 replies

    ferroch85Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:46

    Hi,

    I've this problem:

    I have to calculate the execution time of an application on the STR9.

    I tried to use an RTC, but when i print the milliseconds left ( i used RTC_GetTime()), they are always 0.

    I've fixed the bug in the function gettime, but nothing changed.

    I used those parameters:

    RTC_TIME time;

    RTC_ITConfig(RTC_IT_Per,ENABLE);

    RTC_CalibClockCmd(ENABLE);

    RTC_PeriodicIntConfig(RTC_Per_2Hz);

    time.seconds=0;

    time.milliseconds=0;

    time.minutes=0;

    time.hours=0;

    RTC_SetTime(time);

    RTC_GetTime(BINARY,&time);

    after the gettime, time.milliseconds is always 0 :(

    I've also uncomment the line #define _RTC , but nothing ...

    Thank you

    Marco

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:46

    Try reading the Tamper bit. It may have triggered, and will freeze the RTC value until it is cleared. (Happened to me yesterday), Also, make sure you have power on the Vbat pin.