beautypg.com

5 watchdog, gpio, and bypass programming, The watchdog sample code of c language as below – Acrosser AR-ES6050FLD-W User Manual

Page 34

background image

Revision: 1.0

3.5 WATCHDOG, GPIO, AND BYPASS PROGRAMMING


3.5.1 Watchdog Programming

This section describes the usage of WATCHDOG. AR-B6050 integrated the

WATCHDOG that enable user to reset the system after a time-out event. User can use a
program to enable the WATCHDOG and program the timer in range of 1~255
second(s)/minute(s). Once user enables the WATCHDOG, the timer will start to count down
to zero except trigger the timer by user’s program continuously. After zeroize the timer (stop
triggering), the WATCHDOG will generate a signal to reset the system. It can be used to
prevent system crash or hang up. The WATCHDOG is disabled after reset and should be
enabled by user’s program.

Please refer to the following table to program WATCHDOG properly, and user could test

WATCHDOG under ‘Debug’ program.

Address port: 2E and Data port: 2F

C:>debug To enter debug mode.
-o 2E 87
-o 2E 01
-o 2E 55
-o 2E 55

To enter configuration.

-o 2E 07 To point to Logical Device Number Reg.
-o 2F 07 To select logical device 7 (WATCHDOG).
-o 2E 72
-o 2F 40

To select “keyboard reset” as WATCHDOG output to reset system.

-o 2E 72 Preparing to select the unit of timer equals minute or second.
-i 2F

To read the value of index “2F”.

-o 2F xx The value “xx” equals [(value of index “2F”) OR (80)].

OR (80): unit is second.
OR (00): unit is minute.

-o 2E 73 Preparing to set the WATCHDOG timer value.

-o 2F ## The value “##” ranges between 01 ~ FF (1 ~ 255 seconds).

00: To disable WATCHDOG.

-q

To quit debug mode



Notice: The “actual” timer value may not match with the “theoretical”. That is
because of the tolerance of internal oscillating clock and cannot be adjusted or
optimized.



The WATCHDOG sample code of C language as below:

//====================================================================
=======
// Rev Date

Name Description

//====================================================================
=======
// 1.0

12/16/2009 Willy

W83627EHF WatchDog timer test

//====================================================================

34