SerialProtocol - neoxic/ESCape32 GitHub Wiki

  • 460800 baud, 8 data bits, no parity, 1 stop bit.
  • Update rate is 40Hz or higher.
  • At least one idle character between frames.
  • Inbound frame format:
    • Byte0: length (N)
    • Byte1: descriptor
      • Command:
        • 0x00: throttle [-2000..2000]
        • 0x01: drag brake adjustment [0..100]
        • 0x02: normal motor direction
        • 0x03: reversed motor direction
        • 0x04: LED on/off bits [0..15]
      • Request:
        • 0x80: combined telemetry
        • 0x81: electrical revolution time (µs)
        • 0x82: temperature (˚C)
        • 0x83: voltage (V/100)
        • 0x84: current (A/100)
        • 0x85: consumption (mAh)
      • Note: Only the last descriptor can be a request.
    • Byte2: value1 or low byte (if required)
    • Byte3: value2 or high byte (if required)
    • ...
    • ByteN-1: CRC8 (byte0..byteN-2)
  • Outbound frame format:
    • Combined telemetry (0x80):
      • Byte0: length (12)
      • Byte1: ESC temperature
      • Byte2: motor temperature
      • Byte3: voltage (low byte)
      • Byte4: voltage (high byte)
      • Byte5: current (low byte)
      • Byte6: current (high byte)
      • Byte7: consumption (low byte)
      • Byte8: consumption (high byte)
      • Byte9: electrical revolution time (low byte)
      • Byte10: electrical revolution time (high byte)
      • Byte11: CRC8 (byte0..byte10)
    • Individual telemetry values (0x81..0x85):
      • Byte0: length (4)
      • Byte1: value1 or low byte
      • Byte2: value2 or high byte
      • Byte3: CRC8 (byte0..byte2)