Echelon Neuron C User Manual

Page 179

Advertising
background image

Neuron C Programmer’s Guide

167

COMM_IGNORE

Causes incoming messages to be ignored.

PULLUPS_ON

Enables all internal pullup resistors for Series
3100 devices (the default action is to disable

the pullups, which lowers power

consumption).

TIMERS_OFF

Turns off all timer objects (declared with

mtimer and stimer) in the program.

io-object-name

An input object declared for any one of pins IO_4 through

IO_7. When any I/O transition occurs on the specified pin, the device

wakes up. If this parameter is omitted, I/O is ignored while the
device is in sleep mode. This I/O object can be defined for wakeup

purposes only, or could be used for other I/O purposes as well.

io-pin

Specifies one of pins IO_4 through IO_7. When any I/O transition
occurs on the specified pin, the Neuron Chip or Smart Transceiver

wakes up. If this parameter is omitted, I/O is ignored while the

device is in sleep mode.

For example, to sleep and turn off timers and enable pullups, the call to sleep( ) is

as follows:

sleep(TIMERS_OFF | PULLUPS_ON);

Example:

IO_4 input bit wakeup_pin1;

when timer_expires(timer_2)
{
sleep(COMM_IGNORE, wakeup_pin1);

//or, sleep(COMM_IGNORE, IO_4);

}

You can force sleep mode even though the flush has not completed, as described

in

Forced Sleep

on page 168.

When an event occurs that wakes the Neuron Chip or Smart Transceiver, the
program resumes at the first statement after the sleep function call. If the

sleep( ) call is the last statement in a task, the program returns to the scheduler
after it wakes up.
A device wakes up whenever a packet is received by the transceiver (unless you

specified COMM_IGNORE). The device wakes up even if the packet is not
addressed to the device. You are responsible for putting the device back to sleep

if this occurs.
If a device sleeps for less than the receive timer duration and uses the
comm_ignore option, it could receive duplicate messages or network variable

update events. The default receive timer is set by a network tool during device

installation. The receive timer has a hard-coded minimum value of 768 ms. This
value can be increased by a network tool, depending on the network connections

to the device.

Advertising