Specifications
EPC-21/22 Hardware Reference
Page A4
BB
The 82360SL configuration space is disabled by setting the Lock bit (bit 0) of the
Configuration Lock Register. Calling the
disablespace function below with the
processor flags value returned from the
enablespace function disables the
configuration space and restores the system flags to the state prior to the call of
enablespace.
void
restoreflags(unsigned short flags)
{
ASM
push flags
popf
ENDASM
}
void
disablespace(unsigned short flags)
{
outp(CFGINDEX,0xfa);
outp(CFGDATA,0x01);
restoreflags(flags);
}
Once the 82360SL configuration space is visible, the reset enable, timer command
and timeout value can be programmed. The reset enable is active when bit 0 of the
SMOUTCNTRL (index 0xFE) register is cleared (0). Clearing this bit will cause a
PC reset when half of the timer count programmed into the T2CH2CNT has expired.
The watchdog timer's maximum timeout is 491 milliseconds. This is derived by
multiplying the maximum tick count 65535 (0xFFFF) by the clock frequency (15
microseconds), and then dividing by 2 since the PC is reset when half of the count
has expired.
Using the watchdog timer function requires the installation of a driver that
reprograms the watchdog timer value before half the initial timeout count expires.
This is typically done by chaining the PC timer interrupt and reprogramming the
watchdog timer count within the timeout period.
Listed below is a complete program that implements a watchdog timer function.
The watchdog timer is programmed to reset the PC at 491 milliseconds.
#include <dos.h>
#define ASM _asm {
#define ENDASM }
#define INTERRUPT _interrupt
#define CFGINDEX 0x24 /* configuration space index */
#define CFGDATA 0x25 /* configuration space data
address */
#define T2COMMAND 0x83 /* timer 2 command address */