[Coco] Battery-Backed RTCs for CoCo?

Gene Heskett gheskett at shentel.net
Fri Nov 30 20:08:24 EST 2018


On Friday 30 November 2018 19:26:01 Robert Gault wrote:

> That must be the clock2_coco3fpga.asm as that is "for the Maxim
> Integrated DS3231 RTC."
>
> Again that code gets read more often than is necessary.

Agreed, once a day is sufficient, and by makeing setclock loadable from 
storage and close itself when its done it would save at least a page of 
very badly needed system ram in kernel memory.

Remember, the only place you would have to update is the 6 bytes in the 
DP, the softclock takes and works with whatever is there, so you only 
have to assure is that that the DP the new setclock is using, is the 
same DP the kernel is using. Usually regs.dp=$00.

It really is that simple. In the case of the xt-rtc, I think I'd put it 
in the startup and not worry about a cron job for daily. And w/o any 
spinning rust, I'd just turn it off when done for the session.

> You could use 
> the clock_soft, convert clock2_coco3fpga.asm to a stand alone program,
> and read the RTC every ten or more minutes. As long as the RTC is
> automatically read on a Boot, the system clock will be more than
> accurate enough for any disk file label or other time stamp required.

I agree. You would get perfect time if the clock crystal was 3.5800000 
mhz, but its not, more than likely its in the ballpark of 3.579545 mhz, 
the ntsc color frequency, minus what ever ageing the rock has done 
because the silver plating that is the coupling between the quartz and 
the circuitry, slowly becomes oxidized, and the added weight of the 
oxygen incorporated into the silver plating as this occurs, slows the 
crystal, as much as 10 kilohertz by the time it actually dies. I haven't 
encountered such a coco, so the shack must have bought well sealed 
crystals. The CB radios of the day didn't have such a luxury, so we 
replaced a lot of crystals back in the day.

Your factoid for the day... ;-)

> Dave Philipsen wrote:
> > Actually we have a NitrOS9 driver for the newer (and cheaper) DS3231
> > chip that is so prevalent on many RTC boards available on eBay.  It
> > is currently used on the CoCo3FPGA.  I believe that the general
> > register architecture of the Dallas Semi chips are all pretty much
> > the same. It's just that the older ones were accessed in a slightly
> > different way before the advent of I2C and SPI.

> > Dave



-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>


More information about the Coco mailing list