You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System commands are used to modify/request the state of each unit (e.g. reset) or an the overall system state (e.g. transmission speed)
0x04
Streaming
Streaming commands are used to transmit data streams, but may be also used for single requests. The super frame is also located in this block.
0x08
Statistical Data and Quantity
This command group is used to store statistical data that can be used for histograms such as operating time and the number of power on/off cycles
0x28
Configuration
This command block is used to set configuration data (e.g. you can set the sampling rate of acceleration data here).
0x3D
EEPROM
Used for writing and reading EEPROM data directly
0x3E
ProductData and RFID
Used to store product data like a serial number. Furthermore, this block provides access to RFID information that is supported via connected tools.
0x3F
Test
Test Config Page
Block System
Number
Block Command
Access
Permanently Stored
0x00
Verboten
–
–
0x01
Reset
Event
–
0x02
Get/Set State
Read/Write
–
0x05
Get Node Status
Read/Write
–
0x06
Get Error Status
Read/Write
–
0x0B
Bluetooth
Read
–
Command Verboten
This command is mainly used for initialization purposes
Command Reset
Reset the specified receiver. This command has no payload.
Command Get/Set State
Not fully implemented
Startup state determines operating state
Standby state works
Values
Get/Set State:
Value
Meaning
0
Get State
1
Set State
Location:
Value
Meaning
0
No Change
1
Bootloader
2
Application
3
Reserved
State:
Value
Meaning
0
Failure (No acknowledgement will be sent; Only power on resets this state)
1
Error (No active communication)
2
Turn Off/Standby
3
Graceful degradation level 2
4
Graceful degradation level 1
5
Operating
6
Startup
7
No change
Error Reason:
Value
Meaning
1
Set state not available
2
Wrong subscriber (e.g. accessing application as bootloader)
Payload
Byte 1
Bit 7
Bit 6
Bit 5 – 4
Bit 3
Bit 2 – 0
Get/Set State
Reserved
Location
Reserved
State
Acknowledgment Payload
Byte 1
Bit 7
Bit 6
Bit 5 – 4
Bit 3
Bit 2 – 0
Get/Set State
Reserved
Location
Reserved
State
Error Payload
Byte 2
Error Reason
Command Get Node Status
Note that the state may not be set instantly.
The node status word is defined differently for STH and STU
STH node status word:
typedefunion
{
struct
{
uint32_tbError :1; /**< Error or healthy */uint32_tu3NetworkState :3; /**< Which state has node in the network */uint32_tReserved :28; /**< Reserved */
};
uint32_tu32Word;
uint8_tau8Bytes[4U];
} NodeStatusWord_t;
STU node status word:
struct
{
uint32_tbError :1; /**< Indicates an overall Error */uint32_tu3NetworkState :3; /**< Which state has node in the network */uint32_tbEnabledRadio :1; /**< Radio port enabled(1) or disabled(0) */uint32_tbEnabledCan :1; /**< CAN port enabled(1) or disabled(0) */uint32_tbRadioActive :1; /**< Radio Active(Connected to Bluetooth) or not */uint32_tReserved :25; /**< Reserved */
};
uint32_tu32Word;
uint8_tau8Bytes[4U];
} NodeStatusWord_t;
Error Bit:
Value
Meaning
0
No Error
1
Error
Network State:
Value
Meaning
0
Failure
1
Error
2
Standby
3
Graceful Degradation 2
4
Graceful Degradation 1
5
Operating
6
Startup
7
No Change
Radio Port:
Value
Meaning
0
Radio Port Disabled
1
Radio Port Enabled
CAN Port:
Value
Meaning
0
CAN Port Disabled
1
CAN Port Enabled
Radio Activity:
Value
Meaning
0
Disconnected from Bluetooth
1
Connected to Bluetooth
Payload
Setting the value 0 for the node status word mask means that we request the status word
Currently the only supported payload should be 8 null (0x00) bytes
STH
Byte 1
Bit 7 – 4
Bit 3 – 1
Bit 0
Reserved
Network State
Error Bit
STU
Byte 1
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3 – 1
Bit 0
Reserved
Radio Activity
CAN Port Enabled
Radio Port Enabled
Network State
Error Bit
STH & STU
Byte 2
Reserved
Byte 3
Reserved
Byte 4
Reserved
Byte 5
Status Word Mask
Byte 6
Status Word Mask
Byte 7
Status Word Mask
Byte 8
Status Word Mask
Acknowledgement Payload
Same structure as payload
Error Payload
The (possibly incorrect) length of the status word (5 instead of 4 bytes) was taken from the original documentation.
Byte 1
Mask Used Not Allowed
Byte 4
Status Word
Byte 5
Status Word
Byte 6
Status Word
Byte 7
Status Word
Byte 8
Status Word
Command Get Error Status
STH definition:
typedefunion
{
struct
{
uint32_tbTxBluetoothFail :1; /**< Tx Fail Counter for Bluetooth (non single set) */uint32_tbAdcOverRun :1; /**< Determines ADC over run (not able to shuffle data in time) */uint32_tReserved :30;
};
uint32_tu32Word;
uint8_tau8Bytes[4U];
} ErrorStatusWord_t;
STU definition:
typedefunion
{
struct
{
uint32_tbTxCanFail :1; /**< Tx Fail Counter for CAN (non single set) */uint32_tReserved :31; /**< DAC was not fed */
};
uint32_tu32Word;
uint8_tau8Bytes[4U];
} ErrorStatusWord_t;
Transmission Failure (Bluetooth for STH, CAN for STU):
Value
Meaning
0
No Transmission Failure
1
Transmission Failure
ADC Overrun:
Value
Meaning
0
No ADC Overrun Error
1
ADC Overrun Error
Payload
Setting the value 0 for the status word mask means that we request the error status word
Currently the only supported payload should be 8 null (0x00) bytes
STH
Byte 1
Bit 7 – 2
Bit 1
Bit 0
Reserved
ADC Overrun
Bluetooth Transmission Failure
STU
Byte 1
Bit 7 – 2
Bit 0
Reserved
CAN Transmission Failure
STH & STU
Byte 2
Reserved
Byte 3
Reserved
Byte 4
Reserved
Byte 5
Status Word Mask
Byte 6
Status Word Mask
Byte 7
Status Word Mask
Byte 8
Status Word Mask
Acknowledgement Payload
Same structure as payload
Error Payload
Same structure as error payload for node status command
Command Bluetooth
In general you need at least the following commands to connect to an STH
Activate: Activate Bluetooth on the STU
Get number of available devices: Check which STHs are available at the STU
Connect to device (with Bluetooth MAC address) or Connect to device (with device number): Connect to the STH at the specified STU
Connecting to the STH will not work, if you do not check for available devices first
Bluetooth Subcommand
Value
Meaning
0
Reserved
1
Activate
2
Get number of available devices
3
Write device name #1 and set device name #2 to NULL
4
Write device name #2 and push it to STH (read will be equivalent in the future)
5
Read first part (6 bytes) of device name
6
Read second part (2 bytes) of device name
7
Connect to device (with device number)
8
Check if connected
9
Deactivate
10
Get send counter
11
Received RX frames
12
Get RSSI (Received Signal Strength Indication)
13
Read energy mode reduced
14
Write energy mode reduced
15
Read energy mode lowest
16
Write energy mode lowest
17
Get Bluetooth MAC address
18
Connect to device (with Bluetooth MAC address)
The Bluetooth Activate command (on the STU) is required
to enable the advertisement (and hence the OTA update functionality) of the STU and
before you search for sensor devices.
This dual functionality is (probably) also the reason why a second STU might show up in the list of available (sensor) devices.
Device Number: Sequential positive number assigned by STU to available STH nodes
For a single STH this number will be 0
The number 255 (0xff) is reserved for “self addressing” (used for example when we ask a connected STH for its own MAC address). Note: A connected STH also returns its own name, if you use the read name subcommands (5 and 6) and a device number other than 0xff.
Bluetooth Value
Bluetooth Subcommand
Value
0
–
1
–
2
–
3
ASCII string
4
ASCII string (NULL)
5
–
6
–
7
–
8
–
9
–
10
–
11
–
12
–
13
–
14
Byte 3 – 6: Time from normal to reduced energy mode in ms (Little Endian) Byte 7 – 8: Advertisement time for reduced energy mode in 0.625 · ms (Little Endian)
15
–
16
Byte 3 – 6: Time from reduced to lowest energy mode in ms Byte 7 – 8: Advertisement time for lowest energy mode in 0.625 · ms Little endian 0 = read
17
–
18
Bytes of Bluetooth MAC address in reversed order (from right to left)
Bluetooth Return Value
Bluetooth Subcommand
Value
0
NULL
1
6 Bytes containing NULL (0)
2
ASCII string containing the number of available devices
3
ASCII string
4
ASCII string
5
ASCII string containing the first 6 characters of the Bluetooth advertisement name
6
• ASCII string containing the last 2 characters of the Bluetooth advertisement name • NULL if not connected
7
First byte is: •true (1) if in search mode, at least single device was found, no legacy mode and scanning mode active • false (0) otherwise
8
First byte is: • true (1) if connected • false (0) otherwise Followed by 5 bytes containing NULL (0)
9
6 Bytes containing NULL (0)
10
6 Byte unsigned int (Big Endian)
11
6 Byte unsigned int
12
• First byte contains RSSI as signed number • All other bytes are NULL (0)
13
Byte 3 – 6: Time form normal to reduced energy mode in ms Byte 7 – 8: Advertisement time for reduced energy mode in 0.625 · ms Big Endian
14
Byte 3 – 6: Time form normal to reduced energy mode in ms (Little Endian) Byte 7 – 8: Advertisement time for reduced energy mode in 0.625 · ms (Little Endian)
15
Byte 3 – 6: Time form reduced to lowest energy mode in ms Byte 7 – 8: Advertisement time for lowest energy mode in 0.625 · ms Little Endian
16
Byte 3 – 6: Time form reduced to lowest energy mode in ms Byte 7 – 8: Advertisement time for lowest energy mode in 0.625 · ms Little Endian
17
Bytes of Bluetooth MAC address in reversed order (from right to left)
18
Bytes of Bluetooth MAC address in reversed order (from right to left)
Payload
Byte 1
Bluetooth Subcommand
Byte 2
Device Number
Byte 3 – 8
Bluetooth Value
Note: Use 0 bytes if Device Number or Bluetooth Value are not applicable (e.g. when you use the Activate command)
Acknowledgement Payload
Byte 1
Same as Payload
Byte 2
Same as Payload
Byte 3 – 8
Bluetooth Return Value
Block Streaming
Number
Block Command
Access
Permanently Stored
0x00
Data
Event
–
0x20
Voltage
Event
–
Values
The Data Sets bits used in the sections below can have the following values:
Value
Data Amount
0
Stop (stream)
1
1 data set
2
3 data sets
3
6 data sets
4
10 data sets
5
15 data sets
6
20 data sets
7
30 data sets
The streaming data itself can have the following structure:
value 1
value 2
value 3
value 1 / value 2 / value 3
value 1 / value 2
value 1 / value 3
value 2 / value 3
The chronological order starts with the oldest value (BP) and continues with newer values (BP + t), where t is the time point.
Request:
Value
Meaning
0
Single Request
1
Stream
Bytes:
Value
Meaning
0
2 Bytes for each data point
1
3 Bytes for each data point
Active
Value
Meaning
0
Data for specified data point will not be measured/sent
1
Data for specified data point will be measured/sent
Command Data
This command is usually used to access acceleration streaming data (for certain axes)
On newer firmware/hardware the streaming command might return other data as well (temperature, force, …)
We refer to measurement channel 1 (2 and 3) in the text below, while we previously used the term x-axis (y-axis and z-axis)
Requesting while streaming is possible
Only single stream allowed
Requesting stream in different format stops last stream
Tuple format (depending on active channel, see payload):
1/2/3
1/2
1/3
2/3
Payload
Byte 1
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2 – 0
Request
Bytes
Channel 1 Active
Channel 2 Active
Channel 3 Active
Data Sets
Acknowledgment Payload
Byte 1
Same as Payload
Byte 2
Sequence Counter
Streaming Data Bytes
Data is sent in little endian order (at least for 2 byte format)
Older streaming data is stored in first bytes, newer data in later bytes
Values are stored in first available bytes,
first measurement channel 1 (x) (if requested),
then measurement channel 2 (y) (if requested),
then measurement channel 3 (z) (if requested)
Data length depends on requested values and number of sets
Examples
Request first measurement channel
Single data set
2 Byte format
Byte 3
Value Channel 1 (LSB)
Byte 4
Value Channel 1 (MSB)
Request second and third measurement channel
Single data set
2 Byte format
Byte 5
Value Channel 2 (LSB)
Byte 6
Value Channel 2 (MSB)
Byte 7
Value Channel 3 (LSB)
Byte 8
Value Channel 3 (MSB)
Command Voltage
Notes
Highest voltage sampling rate determines bit stream rate
Requesting while streaming is possible
To determine the supply/battery voltage (voltage 1) value you need to multiply the returned values with the number 5.7. This is the result of the voltage divider circuit we use (which contains a 470 kΩ and 100 kΩ resistor).
Payload
Byte 1
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2 – 0
Request
Bytes
Voltage 1 Active
Voltage 2 Active
Voltage 3 Active
Data Sets
Acknowledgment Payload
The command uses the same format as the “Acknowledgment Payload” of the Acceleration command.
Block Statistical Data and Quantity
Number
Block Command
Access
Permanently Stored
0x00
Power On Cycles, Power Off Cycles
Read
x
0x01
Operating time
Read
x
0x02
Under Voltage Counter
Read
x
0x03
Watchdog Reset Counter
Read
x
0x04
Production Date
Read
x
Command Power On Cycles, Power Off Cycles
Notes
Power off means power away e.g. Accumulator out of energy
Power On includes resets
ACK Payload
Byte 1 (MSB) - Byte 4 (LSB)
Power On Cycles
Byte 5 (MSB) - Byte 8 (LSB)
Power Off Cycles
Command Operating time
Notes
Seconds since first power are stored each half an hour
The STH also stored seconds since reset in disconnect case.
ACK Payload
Byte 1 (MSB) - Byte 4 (LSB)
Seconds since reset
Byte 5 (MSB) - Byte 8 (LSB)
Seconds since first power on
Command Under Voltage Counter
ACK Payload
Byte 1 (MSB) - Byte 4 (LSB)
Under voltage counter since first power on
Command Watchdog Reset Counter
ACK Payload
Byte 1 (MSB) - Byte 4 (LSB)
Watchdog Resets since first power on
Command Production Date
ACK Payload
Byte 1 (MSB) - Byte 4 (LSB)
ASCII String of the Production Date in the format: yyyymmdd where y=year, m=month, d=day
Block Configuration
Number
Block Command
Access
Permanently Stored
0x00
Get/Set ADC Configuration
Read/Write
x
0x01
Get/Set Sensors
Read/Write
x
0x60
Get/Set Calibration Factor k
Read/Write
x
0x61
Get/Set Calibration Factor d
Read/Write
x
0x62
Calibration Measurement
Read/Write
x
0xC0
HMI Configuration
Read/Write
x
Command Get/Set ADC Configuration
Values
Get/Set Config:
Value
Meaning
0
Get Config
1
Set Config
Prescaler:
Possible Values: 1 – 127
Acquisition Time:
Sample and hold time i.e. time to charge capacitor that is cut off and measured at digital quantisation in cycles
$value+1$ iff $value ≤ 3$ (e.g. 4 cycles for a value of 3)
$2^{value-1}$ iff $value > 3$ (e.g. 8 cycles for a value of 4)
Reference Voltage: 3.3 ($V_{DD}$) (byte value = 66)
Recommended Values
The table below list some ADC configuration values we recommend, if you want to change the sample rate from the default of 9524 Hz.
Sample Rate [Hz]
Prescaler
Acquisition Time
Oversampling Rate
9524
2
8
64
9375
3
3
64
8889
2
32
32
6897
2
16
64
4762
2
8
128
3448
2
16
128
2381
2
8
256
1724
2
16
256
1190
2
8
512
862
2
16
512
595
2
8
1024
431
2
16
1024
298
2
8
2048
216
2
16
2048
149
2
8
4096
108
2
16
4096
Command Get/Set Sensors
Notes
If a sensor number sent with a "Set" command is greater than the number of sensors defined by the sensor device then the sensor device will react with an error message.
The sensor number 0 represents a special value that tells the sensor device to keep the current sensor configuration value for the specified measurement channel.
Values
Get/Set State:
Value
Meaning
0
Get State
1
Set State
Payload
Byte 1
Bit 7
Bit 6 – 0
Get/Set State
Reserved
Byte 2
Sensor (number) for first measurement channel
Byte 3
Sensor (number) for second measurement channel
Byte 4
Sensor (number) for third measurement channel
Byte 5 - Byte 8
Reserved
Acknowledgment Payload
Same structure as payload
Command Get/Set Calibration Factor k
Values
Calibration Element:
Value
Meaning
0
Acceleration
1
Temperature
32
Voltage
Number or axis:
Value
Meaning
0
Reserved
1
x-Axis / First measure point
2
y-Axis / Second measure point
3
z-Axis / Third measure point
Get/Set Value:
Value
Meaning
0
Get Value
1
Set Value
Payload
Byte 1
Calibration Element
Byte 2
Number or axis
Byte 3
Bit 7
Bit 6 – 0
Get/Set Value
Reserved
Byte 4
Reserved
Byte 5 (MSB) - Byte 8 (LSB)
k (Slope) according to IEEE 754 single precision (float)
Calibration=kx+d (Also calculation to SI value or any other value)
Acknowledgment Payload
Byte 1
Calibration Element
Byte 2
Number or axis
Byte 3
Reserved
Byte 4
Reserved
Byte 5 (MSB) - Byte 8 (LSB)
k (Slope) according to IEEE 754 single precision (float)
Calibration=kx+d (Also calculation to SI value or any other value)
Command Get/Set Calibration Factor d
Payload and Acknowledgment Payload have the same Structure as Get/Set Calibration Factor k but with d (Offset) instead of k (Slope) from kx+d.
Command Calibration Measurement
Notes
Activating the self test of an accelerometer:
Calibration Get/Set: Get
Calibration Measurement Element: Acceleration
Calibration Method: Activate
seems to only work for the next measurement. This means the STH will return the “normal” acceleration value after you read the acceleration a second time, even if you do not deactivate the self test before the second measurement.
Values
Calibration Get/Set:
Value
Meaning
0
Get (Ignores the remaining bits of this byte)
1
Set
Calibration Method:
Value
Meaning
0
Reserved
1
Activate
2
Deactivate
3
Measure
Calibration Measurement Element:
Value
Meaning
0
Acceleration
1
Temperature (for $V_{REF}=1.25~V$ the temperature is returned in m°C)
32
Voltage
96
VSS (Ground)
97
VDD (Supply)
98
Regulated Internal Power
99
Operation Amplifier Output
Dimension:
Value
Meaning
0
Reserved
1
1. Dimension (x)
2
2. Dimension (y)
3
3. Dimension (z)
Reference Voltage: This value specifies the reference voltage in fractures of $\frac{1}{20}$ of a volt. A common value would be 66 ($\frac{66}{20} = \frac{33}{10} = 3.3$) for the supply voltage ($V_{DD}$ Voltage Drain Drain) of 3.3 V.