Skip to content

Low-level protocol

This document describes the low-level binary communication protocol used between SPORTident devices and the host (typically a PC or phone). The protocol is a packet-based serial communication protocol that operates over USB. The protocol is used by the BSM8 and BSM7 stations as well as by the SRR USB Dongle. The current version of the protocol has been in place since before 2012 and has seen no changes since then.

The earlier legacy protocol (command code <0x80, no length byte, no CRC) is longer documented and supported.

TODO

  • Mention Config+ Debug mode
  • Section on looking for the right USB devices
  • Document typical connection procedure (instead of “station detection procedure”)
  • Document slave mode
  • Document set sysmem?
  • USB devices are always baud rate 38400
  • Document serial interface configuration (only relevant for old serial devices?)
    • baud-rates: 4800 baud, 38400 baud
    • bits: 8
    • parity: no
    • stop bits: 1
    • hardware handshake: no

Packet structure

Basic frame format

All messages follow this structure:

[PRE] [STX] [CMD] [LEN] [DATA...] [CRC_HIGH] [CRC_LOW] [ETX]

Field descriptions:

FieldSizeValueDescription
PRE1 byte0xFFFrame preamble
STX1 byte0x02Start marker
CMD1 bytevariesCommand
LEN1 byte0-255Length of DATA field (not including CMD, LEN, or CRC)
DATA0-255 bytesvariesCommand-specific payload data
CRC_HIGH1 bytevariesCRC-16 high byte
CRC_LOW1 bytevariesCRC-16 low byte
ETX1 byte0x03End marker

Special control bytes

ByteValueNamePurpose
ACK0x06AcknowledgeCommand understood
NAK0x15Negative AcknowledgeCommand not recognized or failed

CRC calculation

Station detection procedure

only really makes sense for serial devices (detecting different baudrates) — so write this in a different way

Commands

Set MS mode

Description: Configure the station’s Master/Slave mode for direct or remote operation.

Command code: 0xF0

Request (TX)

OffsetFieldValueDescription
0CMD0xF0Set MS Mode
1LEN0x01
2Mode0x4D or 0x530x4D = Direct mode
0x53 = Remote mode

Response (RX)

OffsetFieldValueDescription
0CMD0xF0Set MS Mode (echoed)
1LEN0x03
2CN1variesControl number high byte
3CN0variesControl number low byte
4ModevariesCurrent mode

Set system values

Description: Write system configuration values to the device memory.

Command code: 0x82

Request (TX)

OffsetFieldValueDescription
0CMD0x82Set System Values
1LEN1 + NUM
2ADRvariesMemory address to write to
3+DATvariesData to write (NUM bytes)

Response (RX)

OffsetFieldValueDescription
0CMD0x82Set System Values (echoed)
1LEN0x03
2CN1variesControl number high byte
3CN0variesControl number low byte
4ADRvariesMemory address (echoed)

Get system values

Description: Read system configuration values from the device memory.

Command code: 0x83

Request (TX)

OffsetFieldValueDescription
0CMD0x83Get System Values
1LEN0x02
2ADRvariesMemory address to read from
3NUM1-255Number of bytes to read

Response (RX)

OffsetFieldValueDescription
0CMD0x83Get System Values (echoed)
1LEN3 + NUM
2CN1variesControl number high byte
3CN0variesControl number low byte
4ADRvariesMemory address (echoed)
5+DATvariesRequested data (NUM bytes)

Set baud rate

Description: Change the serial communication baud rate. Only meaningful for legacy serial devices, USB devices are always 38400 baud.

Command code: 0xFE

Request (TX)

OffsetFieldValueDescription
0CMD0xFESet Baud Rate
1LEN0x01
2BDR0x00 or 0x010x00 = 4800 baud
0x01 = 38400 baud

Response (RX)

OffsetFieldValueDescription
0CMD0xFESet Baud Rate (echoed)
1LEN0x03
2CN1variesControl number high byte
3CN0variesControl number low byte
4BDRvariesCurrent baud rate

Get backup data

Description: Read backup memory data from the device.

Command code: 0x81

Request (TX)

OffsetFieldValueDescription
0CMD0x81Get Backup Data
1LEN0x04
2ADR2variesAddress high byte
3ADR1variesAddress middle byte
4ADR0variesAddress low byte
5NUM1-255Number of bytes to read

Response (RX)

OffsetFieldValueDescription
0CMD0x81Get Backup Data (echoed)
1LEN5 + NUM
2CN1variesControl number high byte
3CN0variesControl number low byte
4ADR2variesAddress high byte (echoed)
5ADR1variesAddress middle byte (echoed)
6ADR0variesAddress low byte (echoed)
7+DATvariesBackup data (NUM bytes)

Erase backup data

Description: Reset the backup memory pointer.

Command code: 0xF5

Request (TX)

OffsetFieldValueDescription
0CMD0xF5Erase Backup Data
1LEN0x00No payload

Response (RX)

OffsetFieldValueDescription
0CMD0xF5Erase Backup Data (echoed)
1LEN0x02
2CN1variesControl number high byte
3CN0variesControl number low byte

System memory

We document some of the parameters stored in the system memory. Do not overwrite unknown system memory locations as this can render the SPORTident station non-functional or — worse — change the functionality in subtle ways that you might not immediately notice.

OffsetFieldDescription
0x1CEP3Backup memory pointer byte 3 (highest)
0x1DEP2Backup memory pointer byte 2
0x21EP1Backup memory pointer byte 1
0x22EP0Backup memory pointer byte 0 (lowest)
0x74CPCProtocol configuration (see below)

CPC (protocol configuration)

The CPC byte at offset 0x74 controls various protocol and operational modes of the device. Each bit has a specific function:

BitMaskField NameDescription
00x01Protocol VersionAlways 1
(0 = Legacy protocol, 1 = Modern protocol)
10x02AutoSend Mode0 = AutoSend disabled
1 = AutoSend enabled
20x04Communication ModeHas to be 1 for operating mode readout, 0 otherwise
(1 handshake mode, 0 non-handshake mode)
30x08Sprint Mode0 = Sprint mode disabled
1 = Sprint mode enabled
40x10Not usedAlways 0
(Used to be Password Protection)
50x20Stop If Backup Full0 = Continue operation
1 = Stop operation when backup is full
60x40Not usedAlways 0
70x80Not usedAlways 0
(Used to be Read Out After Punch)

Backup memory

Memory access and navigation are done using the „Get backup data“ instruction. The navigation is based on the „memory pointer“ value. The memory pointer directs to the first non used memory location. The memory pointer value has to be read using the „Get system value“ (0x83) instruction.

The backup memory has a size of 128k byte = 0x200000. The lowest address is 0x100 or the backup memory pointer address - 128k. Data stored in the backup memory have to be read out by specifying the backup memory start address and the number of bytes to be read. The maximal record size is 128 bytes. In case of errors in the readout process it is recommended to reduce the record size. The record size NUM should be adapted according to the size of data packages stored in the stations memory:

  • Card data (readout and printout operating modes): 128 bytes
  • Punch data (all other operating modes): Multiple of 8 bytes

The backup memory is organized as a ring buffer. The backup memory address pointer increments automatically and the overflow resets the pointer to the start value. First data will be overwritten.

Punch record

OffsetFieldDescription
0SI2SI-Card number 2 (highest)
1SI1SI-Card number 1
2SI0SI-Card number 0 (lowest)
3DATE1Date high byte
year (bit 7 - 2)
month (bit 1 - 0)
4DATE0Date low byte
month continued (bit 7 - 6)
day of month (bit 5 - 1)
am/pm (bit 0)
5THTime high byte (in seconds, up to 12 hours)
6TLTime low byte (in seconds, up to 12 hours)
7MSMilliseconds in multiples of 1/256 second