Vortex86DX-MSJK CE 6.0 Jump Start - Getting Started Guide
Vortex86DX-MSJK Windows Embedded CE 6.0 R3 Jump Start Rev 2.0
Page 135
Appendix L –
Using Watchdog Timer
There are 2 watchdog timers accessible on the VDX-6326 SBC, WDT0 and WDT1. The codes used to set,
reset and disable WDT0 are different from WDT1.
Using WDT0
To access WDT0 registers, use index port 22H and data port 23H. WDT0 uses 32.768 KHz frequency
source to count a 24-bit counter, and able to support timer interval ranging from 30.5 µ seconds to
512 seconds. WDT0 can be configured to trigger system reset, NMI or IRQ.
Sample codes to configure and use WDT0:
void main(void)
{
unsigned char c;
unsigned int lTime;
outp(0x22,0x13); // Lock register
outp(0x23,0xc5); // Unlock config. register
// Configure WDT0 to trigger in 5 seconds
lTime = 0x20L * 5000L;
outp(0x22,0x3b);
outp(0x23,(lTime>>16)&0xff);
outp(0x22,0x3a);
outp(0x23,(lTime>> 8)&0xff);
outp(0x22,0x39);
outp(0x23,(lTime>> 0)&0xff);
// Configure WDT0 to reset the system when triggered
outp(0x22,0x38);
c = inp(0x23);
c &= 0x0f;
c |= 0xd0;
// 0xd0 configure the WDT0 to reset the system
// Change to 0x10 to configure WDT0 to trigger IRQ3
// Change to 0x20 to configure WDT0 to trigger IRQ4
// Change to 0x30 to configure WDT0 to trigger IRQ5
// Change to 0x40 to configure WDT0 to trigger IRQ6
// Change to 0x50 to configure WDT0 to trigger IRQ7
// Change to 0x60 to configure WDT0 to trigger IRQ9
// Change to 0x70 to configure WDT0 to trigger IRQ10
// Change to 0x90 to configure WDT0 to trigger IRQ12
// Change to 0xa0 to configure WDT0 to trigger IRQ14
// Change to 0xb0 to configure WDT0 to trigger IRQ15
// Change to 0xc0 to configure WDT0 to trigger NMI
// Change to 0xd0 to configure WDT0 to trigger system reset
outp(0x22,0x38);
outp(0x23,c);
// Enable watchdog timer
outp(0x22,0x37);
c = inp(0x23);
c |= 0x40;
outp(0x22,0x37);
outp(0x23,c);
outp(0x22,0x13); // Lock register
outp(0x23,0x00); // Lock config. register