User's Manual Part 2

Software Design
Wireless Sensing Triple Axis Reference design, Rev. 0.9
40 Freescale Semiconductor
5.3.2 ZSTAR protocol Zcommand description
5.3.2.1 ZSTAR_BROADCAST
This command is sent when the USB stick tries to establish connection with the Sensor Board. The USB
stick first generates a new random network number which is then ‘broadcast’ to any Sensor Board that is
not yet connected to a USB stick. The USB stick transmits this command on a free channel, while the
Sensor Board searches all available channels. Once a Sensor Board receives this command, it responds
with a
ZSTAR_CONNECT.
5.3.2.2 ZSTAR_CONNECT
This command is a reply to ZSTAR_BROADCAST, ZSTAR_CALIB or ZSTAR_STATUS commands sent
by the USB stick. The
Zdata field contains the calibration data stored in the Sensor Board, in the following
format:
Figure 5-2
ZSTAR_CONNECT Zdata format
5.3.2.3 ZSTAR_DATA
Once the connection is established, the Sensor Board starts to periodically transmit accelerometer, button
and g-range status data towards the USB stick.
The
Zdata field contains 4 bytes; the actual X, Y and Z accelerometer values and a byte with status
information.
Figure 5-3
ZSTAR_DATA Zdata format
Each transmission of a
ZSTAR_DATA packet is acknowledged by a ZSTAR_ACK packet from the USB
stick, although the Sensor Board does not always open the reception window to receive this
acknowledgement, in order to save the battery charge.
Xvalue (0g) Xvalue (1g) Yvalue (0g) Yvalue (1g) Zvalue (0g) Zvalue (1g)
0 1 2 3 4 5
Zdata bytes:
Xvalue Yvalue Zvalue Status
0 1 2 3
msb lsb
Button1
Button2
unused
g-range
015-27 6bits:
Zdata bytes: