AMX Target Guide Computer Accessories User Manual


 
AMX 68000 Target Guide
K
A
DAK
37
5. Clock Drivers
5.1 Clock Driver Operation
You must provide a clock driver as part of your AMX application so that AMX can
provide timing services. AMX clock drivers are provided with AMX for the timer chips
used on the boards with which AMX has been tested. These drivers are ready for use and
can be installed as described in Chapter 5.3.
An AMX clock driver consists of three parts: an initialization procedure, a clock Interrupt
Service Procedure (ISP) and an optional shutdown procedure.
Clock Startup
The clock initialization procedure must configure the real-time clock to operate at the
frequency defined in your AMX System Configuration Module. It can then install the
pointer to the clock ISP root into the AMX Vector Table and start the clock.
Care must be taken to ensure that clock interrupts do not occur until the clock is properly
configured and the pointer to the clock ISP root is present in the AMX Vector Table.
Your AMX application will not have any AMX timing services until your clock
initialization procedure, say
clockinit, has been executed. The first opportunity for
clockinit to execute occurs when AMX begins to execute your Restart Procedures. It
is recommended that your clockinit procedure be inserted into your list of Restart
Procedures at the point at which you wish the clock to be enabled during the launch.
Although it is not recommended, there is nothing to prohibit you from deferring the
starting of your clock by having some application task call your clockinit procedure.
The clock drivers provided with AMX illustrate how to install and start several different
real-time clocks. You should be able to pattern your clock initialization procedure after
the chip support procedure chclockinit in one of the AMX clock driver source files
CHxxxxT.C.