[sci.electronics] time of year clock chips

phil@amdcad.AMD.COM (Phil Ngai) (05/26/87)

I'm designing a CPU board and wondered if anyone could recommend a
time of year clock chip. Flames about particularly bad or hard to
program time of year clock chips are welcome too. 

-- 
Phil Ngai, {ucbvax,decwrl,allegra}!amdcad!phil or amdcad!phil@decwrl.dec.com

apn@nonvon.UUCP (05/27/87)

in article <16819@amdcad.AMD.COM>, phil@amdcad.AMD.COM (Phil Ngai) says:
> 
> 
> I'm designing a CPU board and wondered if anyone could recommend a
> time of year clock chip. Flames about particularly bad or hard to
> program time of year clock chips are welcome too. 
> 
> -- 
> Phil Ngai, {ucbvax,decwrl,allegra}!amdcad!phil or amdcad!phil@decwrl.dec.com


Most of the OKI chips are good. Small package, easy to program, and very low
power.  Price is competative. I have used them in about 3 of my designs so far.

Alex P Novickis
UUCP: {ihnp4,ames,qantel,sun,seismo,amdahl,lll-crg,pyramid}!ptsfa!nonvon!apn
{* Only those who attempt the absurd   ...   will achieve the impossible   *}
{* I think... I think it's in my basement... Let me go upstairs and check. *}
{*                                                      -escher            *}

grr@cbmvax.UUCP (05/27/87)

In article <16819@amdcad.AMD.COM> phil@amdcad.AMD.COM (Phil Ngai) writes:
> 
> I'm designing a CPU board and wondered if anyone could recommend a
> time of year clock chip. Flames about particularly bad or hard to
> program time of year clock chips are welcome too. 
> 
> Phil Ngai, {ucbvax,decwrl,allegra}!amdcad!phil or amdcad!phil@decwrl.dec.com

The OKI58321 is the low cost leader, but is super slow and needs to be accessed
through some kind of parallel port.

The OKI6242B can interface to a normal microcomputer bus running at normal, but
not blazing speeds and is a good compromise.

Ricoh makes a chip much like the 6242 that includes ~15 bytes of static RAM,
useful for saving configuration or boot up data.

These chips are also available as modules, with battery and/or crystal included,
if the additional cost is a good trade off.

There are lots of other chips available.  Watch out for vapor chips and read
the fine print on accessing, battery backup/voltage requirements and glitch/
latchup protection...

-- 
George Robbins - now working for,	uucp: {ihnp4|seismo|rutgers}!cbmvax!grr
but no way officially representing	arpa: cbmvax!grr@seismo.css.GOV
Commodore, Engineering Department	fone: 215-431-9255 (only by moonlite)

pozar@hoptoad.uucp (Tim Pozar) (05/27/87)

In article <16819@amdcad.AMD.COM> phil@amdcad.AMD.COM (Phil Ngai) writes:
>
>I'm designing a CPU board and wondered if anyone could recommend a
>time of year clock chip. Flames about particularly bad or hard to
>program time of year clock chips are welcome too. 
>
>-- 
>Phil Ngai, {ucbvax,decwrl,allegra}!amdcad!phil or amdcad!phil@decwrl.dec.com

    I would watch out for chips that have the old daylight savings time 
programmed into them.  I know of none that are on the current time 
standard.

-- 
        Tim Pozar
UUCP    pozar@hoptoad.UUCP
Fido    125/406
USNail  KLOK-FM
	77 Maiden Lane
	San Francisco CA 94108

henry@utzoo.UUCP (Henry Spencer) (05/28/87)

> I'm designing a CPU board and wondered if anyone could recommend a
> time of year clock chip. Flames about particularly bad or hard to
> program time of year clock chips are welcome too. 

Of the ones I've seen specs for, the Intersil 7170 is the clear winner.
It does leap years, it does the battery-backup power switchover itself
(just the way it should -- it simply has two power pins, and if the main
pin voltage drops too far, it switches to the backup pin and shuts down
everything except basic timekeeping), it's latched against race conditions
(read the 100ths-seconds register and everything else is latched until
you read that one again), it gives you a settable alarm or a periodic
tick, and it talks to an 8-bit bus with a 300-ns access time.  One thing
I am not sure of is price/availability -- haven't yet used it myself.

The Sun-3 clock is a 7170.
-- 
"The average nutritional value    Henry Spencer @ U of Toronto Zoology
of promises is roughly zero."     {allegra,ihnp4,decvax,pyramid}!utzoo!henry

henry@utzoo.UUCP (Henry Spencer) (05/31/87)

>     I would watch out for chips that have the old daylight savings time 
> programmed into them.  I know of none that are on the current time 
> standard.

I recall none that are aware of daylight savings at all; that is usually
left to the software, with good reason -- too much local variation.  (My
old home town, Saskatoon, ignores the whole stupid business and is on CST
year round.  Why did I come to Toronto... :-))

A subtle point that a number of the chips don't get quite right, by the way,
is the possibility that leap years are not the ones with numbers divisible
by 4.  One chip -- I think it's the Oki one -- has a two-bit register that
you set to indicate the leap-year phase; none of the others do.  All users
of the Gregorian calendar agree (I think) on which years are leap years, but
they do not all agree on what numbers those years have.  The obvious case in
point is Japan, where traditional year numbering is referenced to the date
the current Emperor took the throne.  I'd guess that the Oki chip is the only
one designed in Japan.

(Of course, you can fudge around this in software by just using a different
year as the origin year, since none of these chips have a full four-digit
year register anyway...)
-- 
"There is only one spacefaring        Henry Spencer @ U of Toronto Zoology
nation on Earth today, comrade."   {allegra,ihnp4,decvax,pyramid}!utzoo!henry

jimc@iscuva.ISCS.COM (Jim Cathey) (06/01/87)

In article <8101@utzoo.UUCP> henry@utzoo.UUCP (Henry Spencer) writes:
>>     I would watch out for chips that have the old daylight savings time 
>> programmed into them.

>I recall none that are aware of daylight savings at all; that is usually

The Motorola 146818 _does_ have a daylight savings mode bit, but the notes
with it state that it doesn't work quite right (especially not since they
changed the DST week!)  I think later versions of the documentation mark
that bit as Reserved, Do Not Use!

gnu@hoptoad.UUCP (06/04/87)

The Sun-2 "TOD clock" was the National Semi MM58167.  It's a 24-pin
chip with .001 second resolution and a very slow 8-bit bus interface.  It
requires at least an external 32767Hz crystal and 2 caps.  Here's what
Tom Lyon and Joe Skudlarek had to say about it in "All the Chips that
Fit":

	"Another problem in chip design is the tendency to put
	functionality in the chip which could be done just as well, or
	better, in the software driving the chip.  In fact, users must
	sometimes program around incomplete solutions to create the
	required complete solution; this adds to the complexity of the
	code, costing in development time, and execution time and
	space.  An example here is the National Semiconductor MM58167
	Time Of Year Clock.  This is a low power clock used to keep the
	system time when the system is powered off.  The chip is
	apparently designed to appeal to users of microprocessors which
	can't do division and multiplication, for the chip keeps the
	time in separate registers for the month (no year), day, hour,
	minute, second, etc., rather than just providing a counter
	which counts at a known rate.  In addition, each register is
	kept in BCD format, which makes displaying the time very easy.
	Unfortunately, UNIX doesn't want to display the time, it just
	wants something from which to set its 32 bit counter of seconds
	since Jan. 1 1970, GMT.  An attempt to do a straightforward
	conversion from UNIX time to chip time fails because the chip
	has no support for leap years or daylight savings time.
	Ultimately, we ended up using the chip just as a bizarre
	series of modulo counters; the amount of arithmetic to convert
	chip time to UNIX time is disgusting."

As Henry mentioned, the Sun-3 system clock is the Intersil 7170.
As I recall, there were some problems with the early Intersil 7170's
used in prototyping the Sun-3.  The switch to battery backup was not
painless.  This may have been fixed in future chips, or it may be
that they didn't document how to wire it up well enough.  Check it twice!

The 7170 also provides a 100Hz interrupt, which is what the Sun-3 uses
for its Unix timing, so there is no other clock chip in the Sun-3.  I
find this a bit of a lose, since I like to time things to the
microsecond, but only having one clock chip on the board certainly wins
in other ways.
-- 
Copyright 1987 John Gilmore; you may redistribute only if your recipients may.
(This is an effort to bend Stargate to work with Usenet, not against it.)
{sun,ptsfa,lll-crg,ihnp4,ucbvax}!hoptoad!gnu	       gnu@ingres.berkeley.edu

phil@amdcad.UUCP (06/04/87)

In article <2239@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes:
>	An attempt to do a straightforward
>	conversion from UNIX time to chip time fails because the chip
>	has no support for leap years or daylight savings time.

I've looked at National's three clock chips and it is amusing to watch
them correct their mistakes with each later version. The first one,
58167, as you pointed out, had no leap year support. It had no idea
what the year was at all! The second, the 58174, did have a year
register and leap year support, but the year register was write only!
Finally, with the 58274, they introduced a clock chip which had both
leap year support and a read/write year register. 

As someone else has noted, you really don't want to put daylight
savings time into silicon. 

>	Ultimately, we ended up using the chip just as a bizarre
>	series of modulo counters; the amount of arithmetic to convert
>	chip time to UNIX time is disgusting."

Actually, the lack of leap years and daylight savings time would seem
to make the conversion from chip time to seconds a very
straight-forward series of multiplications and table look ups, unless
I am missing something. You would precalculate the number of seconds
in a year (although I don't know how you figure out what year it is
using the 58167 -- look at the filesystem and hope the system hasn't
been turned off more than one year?), compute the Julian day and
multiply by the number of seconds in a day, etc. 

It is sort of disgusting but I imagine the market for unix time
keeping is much less than the market for VCR clocks and microwave oven
clocks, etc. 

>The 7170 also provides a 100Hz interrupt, which is what the Sun-3 uses
>for its Unix timing, so there is no other clock chip in the Sun-3.  I
>find this a bit of a lose, since I like to time things to the
>microsecond, but only having one clock chip on the board certainly wins
>in other ways.

Could you elaborate on the hardware support you'd like to have to time
things to the microsecond? In particular, does the 29000's on-chip
clock counter seem useful? (40 nS resolution)

-- 
Bumper Snicker: If this car were a horse, it would have to be shot!
Phil Ngai, {ucbvax,decwrl,allegra}!amdcad!phil or amdcad!phil@decwrl.dec.com