Free Star Pro Series ZFSM-201-EVB-1 Evaluation Board Host Serial & RF Protocol Guide ZFSM-201-1 FreeStar Pro Module Document # 0006-00-08-01-000 (Rev A) FreeStar Pro Host & RF Protocol Table of Contents 1 HOST SERIAL PROTOCOL .................................................................. 3 1.1 UART PROTOCOL ............................................................................................ 3 1.2 UART MESSAGE TYPES.................................................................................. 3 1.2.1 Query Version ........................................................................................................ 3 1.2.2 Static Test Mode .................................................................................................... 3 1.2.3 Query Settings ....................................................................................................... 3 1.2.4 XTAL Control.......................................................................................................... 4 1.2.5 PERT Transmit ....................................................................................................... 4 1.2.6 Query Statistics ..................................................................................................... 4 1.2.7 Clear Statistics ...................................................................................................... 4 1.2.8 Range Test Receive ............................................................................................... 5 1.2.9 Save Setting to NVM ............................................................................................. 5 1.2.10 Range Test Transmit ............................................................................................. 5 1.2.11 Buck Regulator ...................................................................................................... 6 1.2.12 ADC Channels ....................................................................................................... 6 1.2.13 PERT Receive ........................................................................................................ 6 1.2.14 Low Power Settings .............................................................................................. 6 1.2.15 GPIO Outputs ......................................................................................................... 7 1.2.16 ED Scan .................................................................................................................. 7 2 SMAC RF INTERFACE PROTOCOLS .................................................. 8 2.1 SMAC RF PROTOCOL...................................................................................... 8 2.2 SMAC RF MESSAGES TYPES ......................................................................... 8 2.2.1 PERT Message ....................................................................................................... 8 2.2.2 Range Message ..................................................................................................... 8 2.3 SMAC RF PROTOCOL STATUS FIELD............................................................ 8 3 MAC RF INTERFACE PROTOCOLS .................................................... 9 3.1 MAC RF PROTOCOL ........................................................................................ 9 3.2 MAC RF MESSAGES TYPES ........................................................................... 9 3.2.1 PERT Message ....................................................................................................... 9 3.2.2 Range Message ..................................................................................................... 9 3.3 MAC RF PROTOCOL STATUS FIELD .............................................................. 9 4 REVISION HISTORY ............................................................................. 9 Rev A 0006-00-08-01-000 Page 2 of 10 FreeStar Pro Host & RF Protocol 1 HOST SERIAL PROTOCOL This document describes in detail the message protocols used by the FreeStar Pro Test Tool program to communicate between the Host PC and the ZFSM-201-EVB-1 Evaluation Board. 1.1 UART PROTOCOL The generic UART Protocol is defined below: Table 1 – UART Host Serial Protocol Structure Start Length Type Payload CheckSum* EOF 0x01 Payload + 5 See below Variable Variable 0x04 VALUE 1 1 1 Variable 1 1 #BYTES *CheckSum is calculates as the LSB of the sum of the bytes within the frame from the ‘Start’ field to the ‘Payload’ field (not including the ‘CheckSum’ or ‘EOF’ bytes). Example: Message Type 02 (See Table 2, Section 1.2.2) Start: 1 Length: 8 (Payload +5) Type: 1 Payload: (Mode, Ch, Pwr) 3 Checksum: 13 1.2 UART MESSAGE TYPES The specific UART message types are defined below: Note: Message Types 0x01 ~ 0x7F are Host → Transceiver messages. Message Types 0x81 ~ 0xFF are Transceiver → Host messages. (When a Transceiver receives a valid message from a HOST, it sends an acknowledgment (ACK) message back to the Host.) Table 2 – Descriptions of Specific UART Message Types Message Type 1.2.1 ACK Message Type Message Length 5 0x81 31 0 26 5-bytes 16-bytes 5-bytes 1 byte 0x82 8 1 byte 1 byte 1.2.3 Set Static Test Mode Mode: 0 = IDLE 2 = RX 3 = TX_UNMOD 4 = TX_MOD 5 = PRBS RF Channel (11-26) 0 = channel 11 … 15 = channel 26 RF Power (0-18) Query Settings 0x03 (03) 0x83 Rev A Query Version Reply to Query MACA Version ASCII SMAC Version ASCII Application Firmware Version ASCII Static Test Mode 3 0x02 (02) Description Query Version 0x01 (01) 1.2.2 Payload 5 14 0 9 Query Settings Reply to Query 0006-00-08-01-000 Page 3 of 10 FreeStar Pro Host & RF Protocol Message Type ACK Message Type Message Length Payload 1 byte 1 byte 1 byte 1 byte 1 byte 1 byte 2 bytes Codebase: 1 = SMAC 2 = MAC 3 = ZigBee Mode (MSB) RF Channel (11-26) RF Power (0-18) XTAL_CTUNE[4] 0 = NO 4pF, 1 = 4pF XTAL_CTUNE[3:0] = 0-7 where 0 is 0pF… 7 is 7pF XTAL_FTUNE[4:0] = 0-5pf in 32 steps (156fF/step) (LSB) ID 3 1 byte 1 byte 1 byte Set Reference XTAL Control XTAL_CTUNE[4] 0 = NO 4pF, 1 = 4pF (MSB) XTAL_CTUNE[3:0] = 0-7 where 0 is 0pF… 7 is 7pF XTAL_FTUNE[4:0] = 0-5pf in 32 steps (156fF/step) (LSB) 9+n 2-bytes 2-bytes 2-bytes 1 byte 1 byte Transmit Packet Error Rate Test Number of Packets to TX (1-1000) (MSB) Source Address Destination Address RF Channel (11-26) RF Power (0-18) Number of Bytes to transmit 13 if test tool application n-bytes if other message 100 max 13 if test tool application n-bytes if other (custom) message Transmit Packet Error Rate Test - ACK Number of Packets to TX (1-1000) (MSB) Source Address Destination Address RF Channel (11-26) RF Power (0-18) Number of Bytes to expect 13 if test tool application n-bytes if other message Message to transmit 13 if test tool application n-bytes if other message 100 max 1 byte 1.2.4 0x04 (04) 1.2.5 XTAL Control 0x84 8 PERT Transmit 14 + n (27) 0x05 (05) 1 byte n-bytes 0x85 14 + n (27) 9+n 2-bytes 2-bytes 2-bytes 1 byte 1 byte 1 byte n-bytes 1.2.6 Query Statistics 0x06 (06) 5 0x86 1.2.7 21 0 16 4-bytes 4-bytes 4-bytes 4-bytes Query Statistics Reply to Query Number TX’d Data packets (MSB) Number RX’d Data packets Number TX’d ACK packets Number RX’d ACK packets (LSB) 0 16 4-bytes Clear Statistics Acknowledgement of Clear Number TX’d Data packets (MSB) Clear Statistics 0x07 (07) 5 0x87 Rev A Description 21 0006-00-08-01-000 Page 4 of 10 FreeStar Pro Host & RF Protocol Message Type 1.2.8 ACK Message Type Message Length Payload 4-bytes 4-bytes 4-bytes Number RX’d Data packets Number TX’d ACK packets Number RX’d ACK packets (LSB) 5 2-bytes 1 byte 1 byte Receive n RF data bytes to destination transceiver ID Destination ID RF Channel (11-26) RF Power (0-18) Number of Bytes to expect 13 if test tool application n-bytes if other message Receive n RF data bytes to destination transceiver ID ACK Source ID Destination ID RF Channel (11-26) RF Power (0-18) Receiver’s RSSI ACK RSSI (if acks enabled) Number of Bytes to expect 13 if test tool application n-bytes if other message 0 if ACK message n-bytes if RF Data Range Test Receive 0x08 (08) 10 1 byte 0x88 14 + n (27) 9+n 2-bytes 2-bytes 1 byte 1 byte 1-byte 1-byte 1 byte n-bytes 1.2.9 Description Save Setting to NVM 0x09 (09) 5 0x89 12 0 7 1 byte 1 byte 1 byte 1 byte 1 byte 2-bytes Save Settings to NVM Acknowledgement of Save RF Channel (11-26) (MSB) RF Power (0-18) XTAL_CTUNE[4] 0 = NO 4pF, 1 = 4pF XTAL_CTUNE[3:0] = 0-7 where 0 is 0pF… 7 is 7pF XTAL_FTUNE[4:0] = 0-5pf in 32 steps (156fF/step) (LSB) ID 9+n 1-byte 2-bytes 2-bytes 1 byte 1 byte 1 byte Send n RF data bytes to destination transceiver ID Require ack (1 = require, 0 = no ack) Source ID Destination ID RF Channel (11-26) RF Power (0-18) 1 = continuous, 0 = single Number of Bytes 13 if test tool application n-bytes if other message Message to transmit 13 if test tool application n-bytes if other message Send n RF data bytes to destination transceiver ID ACK Require ack (1 = require, 0 = no ack) Source ID Destination ID RF Channel (11-26) 1.2.10 Range Test Transmit 14 + n (27) 0x0A (10) 1 byte n-bytes 0x8A Rev A 14 + n (27) 9+n 1-byte 2-bytes 2-bytes 1 byte 0006-00-08-01-000 Page 5 of 10 FreeStar Pro Host & RF Protocol Message Type ACK Message Type Message Length Payload 1 byte 1 byte 1 byte n-bytes Description RF Power (0-18) 1 = continuous, 0 = single Number of Bytes 13 if test tool application n-bytes if other message Message to transmit 13 if test tool application n-bytes if other message 1.2.11 Buck Regulator 0x0B (11) 0x8B 6 1 1 byte Set Buck Regulator (Note: a hardware change to the module is required prior to enabling the buck regulator) 1 = enable, 0 = disable 1.2.12 ADC Channels 1 0x0C (12) 6 0x8C 11 1-byte 6 2 bytes 2 bytes 2 bytes Read ADC Channels 0 = Stop Reading ADC 1 = Start Reading ADC Response ADC1 Value ADC2 Value Battery/Power Supply 1.2.13 PERT Receive 12 + n (25) 0x0D (13) 7+n 2-bytes 2-bytes 1 byte 1 byte 1 byte n-bytes 0x8D 18 + n (31) 13 + n 2-bytes 2-bytes 2-bytes 2-bytes 2-bytes 1 byte 1 byte 1 byte n-bytes Receive Packet Error Rate Test Source Address Destination Address RF Channel (11-26) RF Power (0-18) Number of Bytes to expect 13 if test tool application n-bytes if other message Message to receive 13 if test tool application n-bytes if other message 100 max Receive Packet Error Rate Test Number of Received Packets Current Packet Number Number of Expected Packets Source Address Destination Address RF Channel (11-26) RF Power (0-18) Number of Bytes to expect 13 if test tool application n-bytes if other message Ack to message 13 if test tool application n-bytes if other message 1.2.14 Low Power Settings 0x0E (14) Rev A 0x8E 6 1 Low Power 10 Seconds 0006-00-08-01-000 Page 6 of 10 FreeStar Pro Host & RF Protocol Message Type ACK Message Type Message Length Payload 1-byte Description 0 = default 1 = hibernate using 32khz clock 2 = hibernate using 2khz clock 3 = doze 1.2.15 GPIO Outputs 9 GPIO Outputs 0 = restore GPIO 1 = store current GPIO settings and set outputs to values 1-byte below 0x0F (15) 0x8F 14 2 = query output state 4-bytes GPIO31 -> 0 (msb to lsb) i.e. 0x01 = gpio0 4-bytes GPIO63 -> 32 (msb to lsb) i.e. 0x01 = gpio32 Note: not all GPIO’s can be set to outputs safely when the module is on an evaluation board. 1.2.16 ED Scan 0x10 (16) 6 1 1-byte 6 1 22 17 0x90 Rev A Energy Scan Scan Duration/channel (0-14) Two types of response message are possible: An Acknowledgement confirms that the transceiver has received the request. The payload is 1 byte, equal to Duration info. A Results message sends the energy data back to the Host. The payload consists of 1 byte Duration info (set to 0xFE) and 16 bytes for the energy scan results per channel from Ch 11 (MSB) to Ch 26 (LSB). 0006-00-08-01-000 Page 7 of 10 FreeStar Pro Host & RF Protocol 2 SMAC RF INTERFACE PROTOCOLS 2.1 SMAC RF PROTOCOL The generic RF Protocol is defined below: Value #Bytes 2.2 Length Payload + 11 1 Type See Table 4 1 Table 3 – RF Protocol Structure DstID SrcID Status PacketID See Variable Variable Variable Table 5 2 2 1 2 Payload CRC-16 Variable Variable 2 SMAC RF MESSAGES TYPES Specific RF message types are defined below: Table 4 – Descriptions of Specific RF Message Types Message Type 2.2.1 ACK Message Type Message Length Payload PERT Message 15 + n (28) 0x01 n+4 1-byte 1-byte 1-byte 1-byte n-bytes 2.2.2 PERT Message Current Message # MSB Current Message # LSB Total Messages # MSB Total Messages # LSB PERT Data 13 bytes if GUI application Range Message 12 + n (25) 0x02 2.3 Description n+1 1-byte n-bytes Range Message RSSI (if applicable) Range Data 13 bytes if GUI application SMAC RF PROTOCOL STATUS FIELD The status bits of the RF Protocol are defined below: 7 reserved Rev A 6 reserved 5 reserved Table 5 – RF Protocol Status Bits 4 3 2 reserved reserved reserved 0006-00-08-01-000 1 reserved 0 1 = ACK Required Page 8 of 10 FreeStar Pro Host & RF Protocol 3 MAC RF INTERFACE PROTOCOLS 3.1 MAC RF PROTOCOL The generic RF Protocol is defined below: Value #Bytes 3.2 Length Payload +3 1 Type See Table 7 1 Table 6 – RF Protocol Structure Status Payload See Variable (0Table 8 99 bytes) 1 MAC RF MESSAGES TYPES Specific RF message types are defined below: Table 7 – Descriptions of Specific RF Message Types Message Type 3.2.1 ACK Message Type Message Length Payload PERT Message 7+n (20) 0x01 n+4 1-byte 1-byte 1-byte 1-byte n-bytes 3.2.2 PERT Message Current Message # MSB Current Message # LSB Total Messages # MSB Total Messages # LSB PERT Data 13 bytes if GUI application Range Message 4+n (17) 0x02 3.3 Description n+1 1-byte n-bytes Range Message RSSI (if applicable) Range Data 13 bytes if GUI application MAC RF PROTOCOL STATUS FIELD The status bits of the RF Protocol are defined below: 7 reserved 6 reserved 5 reserved Table 8 – RF Protocol Status Bits 4 3 2 reserved reserved reserved 1 reserved 0 1 = ACK Required 4 REVISION HISTORY Revision PRELIMINARY A Rev A Date 28Oct08 04Feb09 Description Released Clarified Command Descriptions 0006-00-08-01-000 Page 9 of 10 FreeStar Pro Host & RF Protocol Table 1 – UART Host Serial Protocol Structure ............................................................................ 3 Table 2 – Descriptions of Specific UART Message Types ............................................................ 3 Table 3 – RF Protocol Structure .................................................................................................... 8 Table 4 – Descriptions of Specific RF Message Types ................................................................. 8 Table 5 – RF Protocol Status Bits ................................................................................................. 8 Table 6 – RF Protocol Structure .................................................................................................... 9 Table 7 – Descriptions of Specific RF Message Types ................................................................. 9 Table 8 – RF Protocol Status Bits ................................................................................................. 9 Rev A 0006-00-08-01-000 Page 10 of 10