cancel
Showing results for 
Search instead for 
Did you mean: 

RTC ,always 0 !!!!

ferroch85
Associate
Posted on September 18, 2007 at 05:49

RTC ,always 0 !!!!

2 REPLIES 2
ferroch85
Associate
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

mark9
Associate II
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.