Hi Steven,

Thanks for this; it looks like you're right.  One side of my crystal was 
> floating at about 1.3V and the other side had AC noise.  When I wrote 
> 0x16aa4009 to LOSC_CTRL_REG I saw that both legs of the crystal now have AC 
> noise.  But I'm still losing about 3 seconds / minute so it's not really a 
> very useful clock.  LOSC_CTRL_REG seems  to default to bit 0 on after a 
> power off.
>

LOSC_CTRL_REG along with some other Timer regs is kept with 1V3 RTC; once 
this is gone (power failure) it will restart to internal... Seems like a 
default behavior. Regarding 3 seconds... either the caps are badly matched, 
or the crystal is crap - you can get a similar Citizen or ECS (they're 
called tuning fork crystal) from Digikey or Farnell and replace that one on 
the board and also replace and rematch the caps. Then it should be quite 
good. Something like:

http://www.digikey.com/product-detail/en/ECS-.327-12.5-13FLX-C/XC1911TR-ND/2781916


> My schematic is for a CB1 (A10) and maybe my CB2 is slightly different.  
> I've seen mention that the internal oscilattor to be 32kHz +/- 20% which 
> sounds pretty sloppy to me.  So I've set the bit to use the external 
> oscillator (does this mean just the crystal or is some kind of 
> fully-fledged oscillator required ?) and I'm still losing 2 or 3 seconds / 
> minute.  This is the same as when I select the internal oscillator.
>

I think both CB1 and CB2 are covered with the same crappy schematic. Pretty 
sure that Crystal is needed for RTC, not full oscillator (you have both IN 
& OUT ports on the CPU, so it's made for crystal). Regarding crappy timing, 
as I said - try either to rematch caps (but that will be hard, as we don't 
know what is load capacitance of this 32k crystal that CB2 has) or just 
replace all together (probably for a price of 1,- EUR).

>
> So the timing is pretty lousy.  Strange because the RTC works well on the 
> CTs.  The other thing I've noticed is that the RTC battery (2025) has gone 
> flat in about 2 months.  Maybe I need a reghargeable battery and to modify 
> the AXP209 settings to charge this battery.
>

Well that's not good news... I also need to think about the battery, but I 
thought that maybe supercap would do a better job, although I'm not sure 
anymore...

By the way - how do you measure the RTC error? I haven't found a nice way 
to do it properly - usually I just set the same time like on Windows/Linux 
and wait for couple of hours and then check again... But there has to be a 
better/nicer way to do this :) I've also tried to compare hwclock to system 
time, but this is also not really elegant, especially because I'm not sure 
which one is right...

Cheers,

Ivan

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to