Infrared input, Hardware considerations, Ge 134), or t – Echelon I/O Model Reference for Smart Transceivers and Neuron Chips User Manual
Page 144
134 Timer/Counter
Input
Models
// Retrieve edge log
edges = io_in(ioTimeStream, buffer, 20);
// Correct for preload offset
for (i = 0; i < edges; i++) {
buffer[i] += preLoad;
}
// Process data
...
}
Infrared Input
The infrared I/O model is used to capture a data stream generated by a class of
infrared remote control devices (see Figure 51 on page 135). This class of devices
generates a stream of ones and zeros by modulating an infrared emitter for an on
and off cycle, each cycle representing either a one or a zero. The period of this
on/off cycle determines the data bit value, a longer cycle implies a one, a shorter
cycle implies a zero. The actual threshold for the on/off determination is set at
the time of the call of the function. The measurements are made between the
negative edges of the input bits unless the invert keyword is used in the I/O
object declaration.
Typically, an infrared signal consists of an infrared source modulated at a carrier
frequency between 38 kHz and 42 kHz. An infrared receiver/demodulator is used
external to the Neuron Chip or Smart Transceiver to produce a digital sequence
with the carrier removed. Upon execution of the io_in( ) function for the infrared
I/O object, the Neuron Chip or Smart Transceiver measures the cycle times and
stores the data bits into a buffer passed to the io_in( ) function.
For a Series 3100 device, a timer/counter is used to make the series of cycle time
measurements. The resolution of these measurements is in units of the clock
period:
period (ns) = measured_value * 2000 * 2^(clock) / input_clock (MHz)
where clock ranges from 0..7
For a Series 5000 device, a timer/counter is used to make the series of cycle time
measurements. The resolution of these measurements is in units of the clock
period:
period (ns) = measured_value * 2000 * 2^(value) / 10 MHz
where value ranges from 0..15
See the edgelog input model for an alternate method to decode infrared inputs.
This model applies to Series 3100 Neuron Chips and Smart Transceivers, and to
Series 5000 Neuron Processors and Smart Transceivers.
Hardware Considerations
The input to this I/O object is the demodulated series of bits from infrared
receiver circuitry. The infrared input model, based on the input data stream,
generates a buffer containing the values of the bits received. The resolution and
range of the timer/counter period options is described in
on page 188.