How to configure Watchdog Function to Your Fanless Industrial Mini PC ?

First, what is a watchdog timer?

Wikipedia said, “A watchdog timer (sometimes called a computer operating properly or COP timer, or simply a watchdog) is an electronic timer that is used to detect and recover from computer malfunctions. During normal operation, the computer regularly resets the watchdog timer to prevent it from elapsing, or “timing out”. If, due to a hardware fault or program error, the computer fails to reset the watchdog, the timer will elapse and generate a timeout signal. The timeout signal is used to initiate corrective action or actions. The corrective actions typically include placing the computer system in a safe state and restoring normal system operation.

Watchdog timers are commonly found in embedded systems and other computer-controlled equipment where humans cannot easily access the equipment or would be unable to react to faults in a timely manner. In such systems, the computer cannot depend on a human to invoke a reboot if it hangs; it must be self-reliant. For example, remote embedded systems such as space probes are not physically accessible to human operators; these could become permanently disabled if they were unable to autonomously recover from faults. A watchdog timer is usually employed in cases like these. Watchdog timers may also be used when running untrusted code in a sandbox, to limit the CPU time available to the code and thus prevent some types of denial-of-service attacks.”

Adeli Fanless Industrial Mini PC J1900 and Newest model support 256 level watchdog function, but many users do not know how to get this feather work, here I attached the .C text file for your kind reference, any further questions are welcome.

Configure watchdog for L09-J1900 model:

Fanless Industrial Mini PC J1900 With 4G Function

#define SIO_CONFIG_INDEX 0x2E
#define SIO_CONFIG_DATA 0x2F

void WatchDogTimer(UINT16 TimerValue) // 1 < TimerValue < 65535 , Unit = Second { // Enter Configuration Mode. IoWrite8(SIO_CONFIG_INDEX, 0x87); IoWrite8(SIO_CONFIG_INDEX, 0x01); IoWrite8(SIO_CONFIG_INDEX, 0x55); IoWrite8(SIO_CONFIG_INDEX, 0x55); //=====================LDN 07====================================// IoWrite8(SIO_CONFIG_INDEX, 0x07); IoWrite8(SIO_CONFIG_DATA, 0x07); #if 1 //Enable WDT //=====================WDT====================================// IoWrite8(SIO_CONFIG_INDEX, 0x74); IoWrite8(SIO_CONFIG_DATA , (UINT8)((TimerValue & 0xFF00)>>8 )); //MSB

IoWrite8(SIO_CONFIG_INDEX, 0x73);
IoWrite8(SIO_CONFIG_DATA , (UINT8)(TimerValue & 0x00FF)); //LSB

IoWrite8(SIO_CONFIG_INDEX, 0x72);
IoWrite8(SIO_CONFIG_DATA , 0x90); //Enable WDT
#endif

#if 0 //Disable WDT
IoWrite8(SIO_CONFIG_INDEX, 0x74);
IoWrite8(SIO_CONFIG_DATA , 0x00); //MSB

IoWrite8(SIO_CONFIG_INDEX, 0x73);
IoWrite8(SIO_CONFIG_DATA , 0x00); //LSB

IoWrite8(SIO_CONFIG_INDEX, 0x72);
IoWrite8(SIO_CONFIG_DATA , 0x00); //Disable WDT
#endif

}

Leave a Reply

Close Menu
×
×

Basket