38
K
A
DAK
AMX 68000 Target Guide
Clock Interrupts
A real-time clock used with the M68000 processor will interrupt either on one of the
interrupt autovectors or on a user defined vector. In either case, the processor will
automatically dispatch through its Vector Table to your clock ISP.
The clock ISP consists of an ISP root and an Interrupt Handler. The processor dispatches
to the ISP root in response to the clock interrupt request. The ISP root calls the clock
Interrupt Handler to dismiss the clock interrupt request. Your clock ISP must be defined
as a conforming ISP of type Clock Handler as described in Chapter 4.3.
In some cases you may be able to create a fast clock ISP which has an ISP root but no
Interrupt Handler. In this case, it is the ISP root which dismisses the clock interrupt
request. Such a clock ISP is defined to be a conforming ISP of type Fast Clock Handler as
described in Chapter 4.4.
In other cases you may be able to pick one of the prebuilt AMX clock ISPs which has an
ISP root but no Interrupt Handler. In this case, it is the ISP root which dismisses the
clock interrupt request. Such a clock ISP is selected from the list which is accessed via
the Prebuilt Clock ISPs... button.
It is the ISP root which informs AMX that a hardware clock tick has occurred. When you
define your clock ISP, your definition of the ISP as a Clock Handler (or Fast Clock Handler)
or your selection of a prebuilt clock ISP ensures that the ISP is recognized by AMX as
the source of its fundamental clock tick operating at the frequency and resolution defined
in your AMX System Configuration Module.
Clock Shutdown
The clock shutdown procedure stops the clock in preparation for an AMX shutdown
following a temporary launch of AMX. If AMX is launched for permanent execution,
there is no need for a clock shutdown procedure.
If you intend to launch AMX for temporary execution, insert your clock shutdown
procedure, say clockexit, into your list of Exit Procedures at the point at which you
wish the clock to be disabled during the shutdown. Usually that will require that
clockexit be the last Exit Procedure in the list because, once you stop your clock, AMX
timing services will no longer be available.
The clock drivers provided with AMX illustrate how to disable several different real-time
clocks. You should be able to pattern your clock shutdown procedure after the chip
support procedure chclockexit in one of the AMX clock driver source files CHxxxxT.C.