> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oryx.mechatronstudio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UART

> Reading an asynchronous serial line: character format, parity and errors.

Every sub-step is one bit. The line idles at **mark**; the start is one bit at
**space** and the stop returns to mark.

## Settings

| Setting       | Options                      | Default |
| ------------- | ---------------------------- | ------- |
| **Data bits** | 5, 6, 7, 8, 9                | 8       |
| **Parity**    | None, Even, Odd, Mark, Space | None    |
| **Stop bits** | 1, 2                         | 1       |
| **First bit** | LSB, MSB                     | LSB     |
| **Idle**      | High, Low                    | High    |

The window shows the resulting format, for example `8N1`.

### The idle level

> On a micro pin, mark is the high level. Pick **low** to read an RS-232 line
> drawn as it looks on the cable, which is inverted.

## Character fields

| Field      | What it is                                                                 |
| ---------- | -------------------------------------------------------------------------- |
| **Start**  | The line drops to space for one bit: the character begins here             |
| **Data**   | The byte, shown in hex, decimal, binary and as text                        |
| **Parity** | Matches or does not match the data                                         |
| **Stop**   | The line returns to mark, ready for the next character                     |
| **BREAK**  | The line stayed at space longer than a whole character: it carries no data |

## Errors it detects

| Problem           | What happened                                                                   |
| ----------------- | ------------------------------------------------------------------------------- |
| **Framing error** | The stop bit came out at space: the character format does not match the drawing |
| **Parity error**  | The parity bit does not match the data                                          |
| **Incomplete**    | The drawing ends before the character is complete                               |
| **BREAK**         | The line stayed at space longer than one character                              |

Every problem appears twice: in the field tooltip, explained in a sentence, and
in the status box, boiled down to a two- or three-word label.

## The summary

Each transmission is summed up in one line: how many bytes it has (`5 B`), and
whether it was `truncated` or whether what is there is a `BREAK` of N bits at
space.

<Note>
  A line entirely at the same level **is not an error**: it is a line you have not
  drawn on yet, or one that is idle, which looks the same.
</Note>

## How to start

With nothing drawn, the status box explains:

> *No character yet. The line idles high: pull it low for one bit as the start,
> then write the data bits, least significant first.*
