RC11xx(HP)-TM
RC25xx(HP)-TM
RC17xx(HP)-TM
2016 Radiocrafts AS
RC11xx(HP)/25xx(HP)/17xx(HP)-TM Data Sheet rev. 1.48 Page 38 of 86
2016 Tiny Mesh AS
Radiocrafts
Embedded Wireless Solutions
Analogue Input Event Triggering
The two analogue inputs
GPIO 0-GPIO 1
may be set to trigger
ANALOGUE 0 INPUT TRIG
or
ANALOGUE
1 INPUT TRIG
event messages when the measured analogue values exceed or go below defined
threshold values. Configurable analogue High and Low settings may be used to create a hysteresis, to
avoid multiple messages to be generated if the analogue signal changes very slowly over time, or is
following a non-linear curve. This will typically be the situation when analogue inputs are used to sense
temperature variations or battery voltage. By setting the
GPIO
ANALOGUE HIGH
, and
ANALOGUE LOW
Trig thresholds to different values, an event message will be triggered when the sampled analogue
signal passes through the hysteresis, from below the low trig value to above the high trig value, or vice
versa. Please see below examples for clarification.
Low- to high trigger
High- to low trigger
Setting the Analogue Input Trigger Level
The analogue high and the low trigger level threshold values must be entered as two-byte values in the
GPIO
analogue trigger parameters in Configuration Memory. The maximum trigger level values are
2047, or Hex 0x7FF, entered as High byte = 0x07, and Low byte = 0xFF.
Calculate the Trigger Value as:
Trigger Value = Analogue trigger voltage * 2047/1.25
Example:
Analogue trigger voltage = 0.75[V]
First find the Trigger Value = 0.75* 2047/ 1.25 = 1228
Divide the Trigger Value by 256 to find the Trigger High Byte value:
1228 / 256 = 4.796 => High Byte = 4
Then calculate the Low Byte value by subtracting the value of the High Byte from the Trigger Value:
1228 – (4 * 256) => Low Byte = 204 (Hex 0xCC).
Note:
GPIO 0-GPIO 1
are both pulled high by an internal 20k resistor when used for digital input or
output. The internal pull-up is disabled when used as analogue inputs, causing the impedance of the
analogue inputs to be in the +100kohm range.
Setting the Analogue Input Sampling Interval.
The analogue sampling interval may be set in steps of 10ms, by changing the
GPIO 0 ANALOGUE
SAMPLING INTERVAL
or
GPIO 1 ANALOGUE SAMPLING INTERVAL
for values between 0.01s and 2.55s.
The analogue measurement value is calculated as the sliding average value of the last eight samples.
The sliding average and the sampling interval may be used as a filter function to eliminate spurious
glitches in the measured voltage. The default sampling interval is set for 1 second.