ts-7000
[Top] [All Lists]

[ts-7000] Re: TS-7800 RTC problem

To:
Subject: [ts-7000] Re: TS-7800 RTC problem
From: "charliem_1216" <>
Date: Tue, 11 Mar 2008 15:19:56 -0000
Hi --

--- In  "e8mn" <> wrote:
>
> --- In  "jirimacku" <jirimacku@> wrote:
> >
> > The time obtained from RTC by rtc7800 makes random jumps. To find out
> > more details I added following to crontab:
> > 
> > 0,10,20,30,40,50 * * * * /usr/local/bin/rtc7800; date >>
> /var/log/rtc.log
> > 
> > Interesting parts of rtc.log:
> > 
> > Mon Mar 10 15:30:12 CET 2008
> > Mon Mar 10 15:40:05 CET 2008
> > Mon Mar 10 15:50:04 CET 2008
> > Thu Mar 13 20:00:06 CET 2008   (+ 76 h)
> > *********************************** 
> > Thu Mar 13 20:40:06 CET 2008
> > Thu Mar 13 20:50:04 CET 2008
> > Thu Mar 13 09:00:05 CET 2008   (- 12 h)
> > ***********************************
> > Thu Mar 13 19:20:10 CET 2008
> > Thu Mar 13 19:30:11 CET 2008
> > Thu Mar 13 19:40:07 CET 2008
> > Thu Mar 13 19:50:12 CET 2008
> > Tue Mar 11 12:00:12 CET 2008   (- 50 h)
> > 
> > After correction (ntpdate, rtc7800 -s)
> > Tue Mar 11 11:20:05 CET 2008
> > Tue Mar 11 11:30:05 CET 2008
> > Tue Mar 11 11:40:05 CET 2008
> > Tue Mar 11 11:50:04 CET 2008
> > Fri Mar 14 20:00:05 CET 2008   (+ 80 h)
> > 
> > There was no reboot during the test.
> > 
> > I'm booting the factory preloaded Debian from on-boad flash.
> > I use the current version of rtc7800 from ts's ftp site.
> > 
> > Because I'm new to ts systems may be I'm doing something wrong.
> > 
> > Thank you for any hints.
> > 
> > Jiri
> >
> 
> I can verify this behavior. I am running on onboard flash with distro
> debian-sarge-udev-512MB-jan182008.tar.gz 
> Updated tsuart1.ko module and using latest rtc7800.
> 
> I can't predict when it happens, it apears to be random. But 

No, it looks to be always near the hour-rollover.  Can you confirm if
that's the case for you too?  [I don't have a TS-7800 to test].

reseting
> system clock from hwclock with rtc7800 corrects time again (given that
> the hwclock is correct). So it probably is not a problem with the rtc.
> 
> Michael Nordseth
> TLab West AB
>

I guess the RTC registers are changing during the time the six
registers are being read.  According to the RTC datasheet, the clock
register values can be 'frozen' by writing to bit 7 of control
Register B.  The code currently does this when setting the RTC, but
not reading from it.

Can you try adding the following patch (untested!):
    
--- rtc7800.c   2008-03-11 11:17:48.000000000 -0400
+++ rtc7800_test.c      2008-03-11 11:16:55.000000000 -0400
@@ -95,6 +95,7 @@
     struct timeval tv;
     int h,pm;
 
+    wRTC(0xB,rRTC(0xB) | 0x80);  // disable update
     t.tm_sec = frombcd(rRTC(0x0));
     t.tm_min = frombcd(rRTC(0x2));
     h = rRTC(0x4) & 0x7F;
@@ -103,6 +104,7 @@
     t.tm_mon = frombcd(rRTC(0x8)) - 1;
     t.tm_year = frombcd(rRTC(0x9)) + 100;
     t.tm_isdst = -1;
+    wRTC(0xB,rRTC(0xB) & ~0x80); // re-enable update
 
     now = mktime(&t);
     tv.tv_sec = now;



Regards, ............. Charlie




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU