8
SM-UM-0004-01
crc = (crc << 8) ^ crc_table[(crc >> 8) ^ *p];
p++;
}
return crc;
}
For more information on how to use the above function, please look at the sample test program
“Sample Code” located
https://nevadanano.com/downloads
2.1.4.
Startup and Measurement Sequence
Figure 3 describes the recommended steps after powering on the sensor plus the measurement
sequence for getting answer data. The major steps consist of the following:
After powering on the sensor, wait for the sensor to boot up completely (~3 seconds).
Verify communication channel by asking the sensor for version information.
o
Firmware version information can be used to determine if a new firmware is available
for upgrade.
o
Protocol version can be used to determine available commands, answers or new data.
Start measurement in “continuous” mode.
Wait 2 seconds for the first measurement to complete.
Get Answer.
Repeat process to get answer at desired frequency.
The sensor initializes for the first 10 cycles after powering up. During this period, the sensor output is
set to
“
-100 %LEL
”,
the sensor status is set to HW_SENSOR_INITIALIZATION, and the sensor is not
capable of reporting gas concentrations. Once initialization is complete, the sensor is ready to report
gas concentrations, and the status is set to 0x00.
Note: It takes approximately 2 seconds to calculate and complete a measurement. If multiple
requests to read the Answer register (0x01) were made within a two-second window, one might get the
same answer. This depends on whether a new measurement is calculated between multiple Answer
requests. The MPS Cycle Count (“COUNT”) in the Answer Response is incremented after each
measurement is calculated. Therefo
re, when processing an “answer,”
one should compare the
COUNT value in the answer against the COUNT value from the previous answer. If the COUNT
value did not increment, this a repeated answer. If the COUNT value incremented, this is a new
answer from the latest measurement cycle. When continuous measurement is stopped and restarted,
the COUNT value resets to 1 with the first measurement.