[comp.os.cpm] need Z80 CTC / Altos clock info

ameyer@nsscb.UUCP (Andy Meyer) (10/28/88)

I am trying to read the realtime clock on an Altos 5-15ad under CP/M.
The documentation only tells me it's channel 3 of a Z80 CTC, and I have
no information on how to read/update this chip. Does it have registers?

Has anyone got this machine? It runs CP/M and MP/M (3 users) and can fit
700k on a 5.25" floppy!

ADVthanksANCE
Andy

    ==--      Andreas Meyer, N2FYE
  -====---    AT&T National Systems Support Center
  --==----    South Plainfield, NJ
    ----      uucp: ..!rutgers!psuvax1!nsscb!ameyer

rlb@xanth.cs.odu.edu (Robert Lee Bailey) (10/29/88)

In article <538@nsscb.UUCP> ameyer@nsscb.UUCP (Andy Meyer) writes:
>I am trying to read the realtime clock on an Altos 5-15ad under CP/M.
>The documentation only tells me it's channel 3 of a Z80 CTC, and I have
>no information on how to read/update this chip. Does it have registers?

I'm not familiar with the Altos, but, I am familiar with the Z-80 CTC.
The Z-80 CTC has 4 independent counter/timer channels. Each is 
individually programmable.  In the counter mode, a value is loaded
into the CTC, which then counts down to zero and generates an
interrupt(one time only).  In the timer mode, a value is loaded into
the CTC, which then counts down to zero, generates an interrupt,
and then starts over again (the interrupt occurs repeatedly).

The bottom line is that you need to know what the interrupt vector
is for the CTC. That is the location of the routine that is 
executed when an interrupt occurs.  I have a Xerox 820 which uses
the CTC to generate an interrupt once each second to perform a
real-time clock function.  The CTC interrupt handler gains control
after each interrupt.  This routine then increments a memory
location, checks to see when it reaches 60 (secs), resets that
location to zero, and increments the minute address, etc.

If you have the source to your BIOS, you may find the answer as to
where your interrupt vector is located.  If not, you may be able
to find the address(es) that are being incremented on each 
interrupt by using DDT to dump sections of memory.  Just repeatedly
dump the same area and look for one or more addresses that are
being incremented once each second.  When you have found the
address, you can then write a routine to examine the addresses and
get the current time value.

I hope that this is of some help, although I realize it may be
somewhat vague.

		Bob Bailey