74
K
A
DAK
AMX Timing Control
It is preferred that the AMX Clock Handler be called from a clock ISP coded in assembly
language as in the example already provided. However, it is possible to code the clock
ISP in C as indicated in the following example. This C solution is not recommended
since it significantly increases the service overhead for every clock interrupt.
The clock ISP and Restart Procedure can be written as Large or Medium model C
functions without formal parameters.
#include "amx831cf.h" /* AMX C Interface Header */
static struct amxisps isproot; /* Clock ISP root */
void cdecl clockih(void) /* Clock Interrupt Handler */
{:
Dismiss clock interrupt and keep clock running
Do not enable interrupts.
:
ajclk(); /* AMX Clock Handler */
}
void cdecl rrclk(void) /* Restart Procedure */
{ajispm(clockih, &isproot); /* Create Clock ISP root */
ajivtw(33, (void (*)())&isproot); /* Install Clock ISP */
}