Syntax, Example, Watchdog_update( ) function – Echelon Neuron C User Manual

Page 175

Advertising
background image

Neuron C Reference Guide

155

Syntax

#include <access.h>

void update_program_id (unsigned char *

pid_p

);

Example

#include <access.h>
unsigned char progID_copy[8];

void f(void)
{
update_program_id(progID_copy);
}

watchdog_update( )

Function

The watchdog_update( ) function updates the watchdog timer. For Series 3100
devices, the watchdog timer times out in the range of .84 to 1.68 seconds with a

10 MHz Neuron input clock. The watchdog timer period scales inversely with the

input clock frequency. For Series 5000 devices, the watchdog timer period is
fixed at 840 ms (1.19 Hz) for all system clock rates. The actual timeout range is

between 0.8 s and 1.7 s.
The scheduler updates the watchdog timer before entering each critical section.
To ensure that the watchdog timer does not expire, call the watchdog_update( )

function periodically within long tasks (or in bypass mode). The post_events( ),

msg_receive( ), and resp_receive( ) functions also update the watchdog timer, as
does the pulsecount output object.
Within long tasks when the scheduler does not run, the watchdog timer could
expire, causing the device to reset. To prevent the watchdog timer from expiring,

an application program can call the watchdog_update( ) function periodically.

Syntax

#include <control.h>
void watchdog_update (void);

Example

void f(void)
{
boolean

still_processing;

...

while (still_processing) {

watchdog_update();

...

}
}


Advertising