Difference between revisions of "Firmware-830 Message-000"

From I-CubeX Wiki
Jump to: navigation, search
(STREAM DATA (0, 00h))
Line 3: Line 3:
 
In host mode the WiDig sends analog sensor input values, after being activated through a [[Firmware-830_Command-001 |STREAM command]], in the STREAM DATA message.
 
In host mode the WiDig sends analog sensor input values, after being activated through a [[Firmware-830_Command-001 |STREAM command]], in the STREAM DATA message.
  
The [BODY] of the STREAM DATA message contains a list of sensor values from all active (turned on) sensors, in ascending order. Inactive sensors are not included in the list. If an analog sensor processing function is enabled and its output is 1024 (eg. in the case of [[Firmware-830_Command-020 |lookup tables]]), it will be output as such. Both 7-bit and 10-bit sensor values are packed together - 10-bit values are sent using two bytes, where the first byte contains the first 7 bits of the sensor value and the second byte contains the last 3 bits of the sensor value:
+
The [BODY] of the STREAM DATA message contains a list of sensor values from all active (turned on) sensors, in ascending order. Inactive sensors are not included in the list. If an analog sensor processing function is enabled and its output is greater than 1023 (eg. in the case of [[Firmware-830_Command-020 |lookup tables]]), it will be output as such. Both 7-bit and 10-bit sensor values are packed together - 10-bit values are sent using two bytes, where the first byte contains the first 7 bits of the sensor value and the second byte contains the last 3 bits of the sensor value:
  
 
<u>7-bit lo-res mode</u>
 
<u>7-bit lo-res mode</u>

Revision as of 03:07, 1 May 2023

STREAM DATA (0, 00h)

In host mode the WiDig sends analog sensor input values, after being activated through a STREAM command, in the STREAM DATA message.

The [BODY] of the STREAM DATA message contains a list of sensor values from all active (turned on) sensors, in ascending order. Inactive sensors are not included in the list. If an analog sensor processing function is enabled and its output is greater than 1023 (eg. in the case of lookup tables), it will be output as such. Both 7-bit and 10-bit sensor values are packed together - 10-bit values are sent using two bytes, where the first byte contains the first 7 bits of the sensor value and the second byte contains the last 3 bits of the sensor value:

7-bit lo-res mode

0yyyyyyy: yyyyyyy = [0..127]; the most significant bits

10-bit hi-res mode

0yyyyyyy: yyyyyyy = [0..127]; the most significant bits
000zzz00: zzz = [0..7]; the 3 least significant bits

Example:

The WiDig has sensor input 1 turned on in lo-res mode (7-bit), sensor input 5 turned on in hi-res mode (10-bit), and sensor input 8 turned on in lo -res mode (7-bit). All other sensor inputs are turned off. The WiDig acquires the value 100 (sensor input 1), 1001 (sensor input 5), and 21 on (sensor input 8). The WiDig sends the following message:

240, 125, 0 {DEV}, 0 {STREAM DATA}, 100 {yyyyyyy of sensor input 1}, 125 {yyyyyyy of sensor input 5}, 8 {zzz00 of sensor input 5}, 21 {yyyyyyy of sensor input 8}, 247 (F0h, 7Dh, 00h, 00h, 64h, 7Dh, 08h, 15h, F7h)

The sampled value from sensor input 5 is 125 * 8 (i.e. 3 bit left shift) + 8 / 8 (i.e. 2 bit right shift) = 1001