# UART Telemetry Output

{% hint style="danger" %}
The UART output is not isolated from the signal input connections. The output must be connected to a different device to the signal generator. Failure to do so will result in permanent damage to the unit.
{% endhint %}

## Reading Datastream <a href="#reading-datastream" id="reading-datastream"></a>

The UART output of the ESC matches the logged data contents. The data stream will begin when the ESC receives a valid throttle signal (arming is not necessary). Datarate is **115200** Baud.&#x20;

### Version 2.0 Structure

The UART output packet structure is valid for firmware versions 2.0 and onwards. This firmware is compatible with version 2.0 onwards of the configuration tool.

#### Packet Structure

| Index | Datapoint           | Size                   |
| ----- | ------------------- | ---------------------- |
| 0     | Voltage             | 16bit Unsigned Int     |
| 1     | Temperature         | 16bit Unsigned Int     |
| 2     | Bus Current         | 16bit Int              |
| 3     | Reserved            | 16bit Unsigned Int     |
| 4     | E-RPM               | 32bit Unsigned Int     |
| 5     | Input Duty          | 16bit Unsigned Int     |
| 6     | Motor Duty          | 16bit Unsigned Int     |
| 7     | Status Flags        | 8bit Unsigned Int      |
| 8     | Reserved            | 8bit Unsigned Int      |
| 9     | Checksum (Fletcher) | 16bit Unsigned Int     |
| 10    | Stop Bytes          | 16bit (Value is 65535) |

**Status Flag Structure**

| Bit Position | Status Purpose                                                                                      |
| ------------ | --------------------------------------------------------------------------------------------------- |
| Bit 0        | Motor Started, set when the motor is running as expected.                                           |
| Bit 1        | Motor Saturation Event, set when saturation is detected and power is reduced for desync protection. |
| Bit 2        | ESC Over temperature event occurring, shut down method as per configuration.                        |
| Bit 3        | ESC Overvoltage event occurring, shut down method as per configuration.                             |
| Bit 4        | ESC Undervoltage event occurring, shut down method as per configuration.                            |
| Bit 5        | Startup error detected, motor stall detected upon trying to start.                                  |
| Bit 6-7      | Unused, Reserved.                                                                                   |

#### Reading Examples

Implementation examples of reading the raw data stream, and calculating values from the raw data.

{% file src="/files/-MkKAO8hVpJuXCO-9O57" %}
UART Read Example C Version 2.0
{% endfile %}

{% file src="/files/-MkKAWN4hL-6uUR0ORek" %}
UART Read Example Python Version 2.0
{% endfile %}

### Version 1.0 Structure

The UART output packet structure is valid for firmware versions 1.0 and onwards. This firmware is compatible with version 1.0 onwards of the configuration tool.

#### Packet Structure

| Index | Datapoint           | Size                   |
| ----- | ------------------- | ---------------------- |
| 0     | Voltage             | 16bit Unsigned Int     |
| 1     | Temperature         | 16bit Unsigned Int     |
| 2     | Bus Current         | 16bit Int              |
| 3     | Reserved 0          | 16bit Unsigned Int     |
| 4     | E-RPM               | 32bit Unsigned Int     |
| 5     | Input Duty          | 16bit Unsigned Int     |
| 6     | Motor Duty          | 16bit Unsigned Int     |
| 7     | Reserved 1          | 16bit Unsigned Int     |
| 8     | Checksum (Fletcher) | 16bit Unsigned Int     |
| 9     | Stop Bytes          | 16bit (Value is 65535) |

#### Reading Examples

Implementation examples of reading the raw data stream, and calculating values from the raw data.

{% file src="/files/-MkK9p90o-JsHs9qhP-3" %}
UART Read Example C Version 1.3
{% endfile %}

{% file src="/files/-MkKA0uHuKg-wPw05JfL" %}
UART Read Example Python Version 1.3
{% endfile %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powerdrives.net/products/uhv/uart-telemetry-output.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
