User Tools

Site Tools


pidflightlap:protocol

This is an old revision of the document!


PIDflight Lap Protocol

The PIDflight Lap protocol uses a slightly modified version of the Multiwii Serial Protocol.

Notes

  • By default all lap timers are activated on power up. (i.e. do not require MSP_ACTIVATE to be sent)

Getting started

  • Open serial connection to lap timing device(s).
    • Baud rate: 115200
  • Application issues MSP_SET_DEVICE_ID to all devices.
    // Initialise all connected devices identifiers starting with 1
    MSP.sendMessage(MSP.WILDCARD_DEVICE_ID, MSP.MSP_SET_DEVICE_ID, 1);
  • Each device found and initialised will return a response to MSP_SET_DEVICE_ID with the ID it has been initialised with.
  • Poll MSP_CURRENT_LAP to detect when a new lap has been recorded on the lap timer.
  • Poll MSP_STATUS to retrieve current status of the lap timer.

MSP message format

MSP codes

NameCodeDescription
MSP_API_VERSION1Firmware API version
MSP_STATUS4
MSP_RESET5
MSP_RSSI_CALIBRATE6
MSP_START7
MSP_ACTIVATE8
MSP_DEACTIVATE9
MSP_DEVICE_ID10
MSP_SET_DEVICE_ID11
MSP_CHANNEL20
MSP_SET_CHANNEL21
MSP_CURRENT_LAP30
MSP_LAP_MIN_TIME34
MSP_SET_LAP_MIN_TIME35
MSP_LAP_MAX37
MSP_SET_LAP_MAX38
MSP_RSSI40
MSP_RSSI_THRESHOLD42
MSP_SET_RSSI_THRESHOLD43
MSP_RSSI_FILTER44TBD
MSP_SET_RSSI_FILTER45TBD
MSP_EEPROM_WRITE250Persists settings to EEPROM for settings to survive a power cycle (if desired)

MSP_API_VERSION

PartTypeDescription
1UINT 8Major version
2UINT 8Minor version

Version is constructed as [PART 1][DECIMAL][PART2][DECIMAL][ZERO] (e.g. 2.6.0)

MSP_STATUS

PartTypeDescription
1UINT 8Device state
2UINT 8Timer state

Device states

ValueState
0Idle
1Timing
2Calibrating
3Inactive

Timer states

ValueState
0Waiting
1Start
2Stop
pidflightlap/protocol.1549617111.txt.gz · Last modified: 2019/02/08 20:11 by cmengler