75XX Watchdog: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
Line 6: Line 6:
! Result
! Result
|-
|-
| 0x0
| 0
| feed watchdog for another .338s
| feed watchdog for another .338s
|-
|-
| 0x1
| 1
| feed watchdog for another 2.706s
| feed watchdog for another 2.706s
|-
|-
| 0x2
| 2
| feed watchdog for another 10.824s
| feed watchdog for another 10.824s
|-
|-
| 0x3
| 3
| disable watchdog
| disable watchdog
|}
|}

Revision as of 15:25, 4 October 2011

The watchdog is manipulated via the ts7500ctl utility. The default INITRD linuxrc autofeeds the watchdog by daemonizing and feeding it in the background via userspace. It can be armed in 3 modes (0 - .4s, 1- 2.7s, 2 - 10.8s). It can be either auto-fed from a background process that continually feeds the watchdog while running (--autofeed option), or via a /dev/watchdog UNIX named pipe which receives single ASCII characters which are written to feed it from another application.

Value Result
0 feed watchdog for another .338s
1 feed watchdog for another 2.706s
2 feed watchdog for another 10.824s
3 disable watchdog

Watchdog by default comes out of reset armed for .338 seconds. TS-BOOTROM firmware feeds for 10.824 and OS code has 10.824 seconds to take over.

You can feed the watchdog from your application by poking a register:

#include <stdio.h>
#include <unistd.h>
#include "sbus.h"

int main(int argc, char **argv)
{
        // This is an example of feeding the watchdog for 10s
        for (;;) 
        {
                sbuslock();
                sbus_poke16(0x74, 2);
                sbusunlock();
                sleep(5);
        }

        return 0;
}