cancel
Showing results for 
Search instead for 
Did you mean: 

RTC issue

thibault2
Associate II
Posted on July 26, 2007 at 14:07

RTC issue

3 REPLIES 3
thibault2
Associate II
Posted on July 16, 2007 at 14:18

Hello,

I'm using a ST10F269.

I noticed a conflict between CAN2 node and RTC.

When I change the configuration of the RTC, it also modifies the configuration of the CAN2 registers. I saw on another ST forum that one guy had the same issue. This is not written in any errata sheet I have seen.

My problem:

When I read the RTC counter value, sometimes I get a value lower than the previous.

For example, if I sample the RTC every second, sometimes I will read a value lower than the previous. Let's say I read 0x00101234 then I will read 0x00101200. The RTC is set in a free running mode without alamr and with a resolution of 499.8µs

Any idea? Have you seen this problem?

thibault2
Associate II
Posted on July 18, 2007 at 12:37

Hello,

Thanks for your answer. Before I answer your question. Can you tell me why ST is not giving us any errat sheet with this CAN2 vs RTC bug??

Timer 4 is used as 1s tick. (Group 0 and Priority 4)

In the isr I have this code

ulTemp = (unsigned long)RTCL + (((unsigned long)RTCH) << 16);

rt_trace_buf[rt_trace_in].ucTraceData = TraceData;

rt_trace_buf[rt_trace_in].uiTraceID = TraceCode;

rt_trace_buf[rt_trace_in].ulTraceTime = ulTemp;

if (rt_trace_buf[rt_trace_in].ulTraceTime < rt_trace_buf [rt_trace_in-1].ulTraceTime)

{

printf(''RTT error\n'');

}

and sometimes, I see the ''RTT error'' message on my terminal.

I would say it happens 2 times every 10 seconds.

I have a lot of interrupts. But when I read RTC values I disable interrupt (IEN = 0) to be sure nothing will prevent me to read it.

This answer your question? Any idea???

Thanks a lot for your attention,

Best regards

Thibault

thibault2
Associate II
Posted on July 26, 2007 at 14:07

ANY IDEA??????????????????????????,