> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/cmde-add-on/model-and-simulation/configure-devices-within-a-ring/device-section/ltc6813.md).

# LTC6813

The **LTC6813** is a virtualized integrated circuit designed to mimic the behavior of a real cell monitoring device. Within the VeriStand project, it is represented as a **Device** item in the configuration tree and is emulated on the FPGA of the Real-Time target upon project deployment.&#x20;

Each LTC6813 device in the **Ring** supports the monitoring of up to 18 battery cells, along with 9 GPIO channels. Passive balancing functionality is also included.

## Section Channels <a href="#section-channels" id="section-channels"></a>

Expand the **Device** section in the configuration tree to display the following VeriStand channels. Channel values can be dynamically modified during execution.

<table><thead><tr><th width="149.888916015625">Channel Name</th><th width="79.66668701171875">Type</th><th width="90.22222900390625">Format</th><th width="70">Units</th><th>Description</th></tr></thead><tbody><tr><td><strong>Enable</strong></td><td>Input</td><td>Binary</td><td> </td><td><p>Enables or disables the emulated device during execution.</p><ul><li><strong>0</strong> - Device is disabled and bypassed for SPI transmission.</li><li><strong>1</strong> - Device is enabled. Normal operation.</li></ul><p>Default value: 1</p></td></tr><tr><td><strong>CRC Check</strong></td><td>Input</td><td>Binary</td><td> </td><td><p>Enables or disables the cyclic redundancy check (CRC) of the command packet error code (PEC) and data packet error code (DPEC) of the SPI transmissions received by the emulated device.</p><ul><li><strong>0</strong> - No CRC check is performed.</li><li><strong>1</strong> - CRC checking is enabled. Normal operation.</li></ul><p>Default value: 1</p></td></tr><tr><td><strong>Port A Enable</strong></td><td>Input</td><td>Binary</td><td> </td><td><p>Enables or disables SPI transmission on the Port A side of the emulated device. Use this channel to simulate a fault in the SPI communication.</p><ul><li><strong>0</strong> - SPI transmission is disabled on the Port A side of the device.</li><li><strong>1</strong> - SPI transmission is enabled. Normal operation.</li></ul><p>Default value: 1</p></td></tr><tr><td><strong>Port B Enable</strong></td><td>Input</td><td>Binary</td><td> </td><td><p>Enables or disables SPI transmission on the Port B side of the emulated device. Use this channel to simulate a fault in the SPI communication.</p><ul><li><strong>0</strong> - SPI transmission is disabled on the Port B side of the device.</li><li><strong>1</strong> - SPI transmission is enabled. Normal operation.</li></ul><p>Default value: 1</p></td></tr><tr><td><strong>Redundancy Fault</strong></td><td>Input</td><td>Binary</td><td> </td><td><p>Forces a digital redundancy fault on the emulated device and stores a digital redundancy fault code in place of the ADC result.</p><ul><li><strong>0</strong> - Digital redundancy check passes.</li><li><strong>1</strong> - Digital redundancy check fails.</li></ul><p>Default value: 0</p></td></tr><tr><td><strong>Selftest Fault</strong></td><td>Input</td><td>Binary</td><td> </td><td><p>Forces a self test fault in response to the CVST, AXST, and STATST commands.</p><ul><li><strong>0</strong> - Device passes the self test and the MUXFAIL bit is set to 0.</li><li><strong>1</strong> - Device fails the self test and the MUXFAIL bit is set to 1.</li></ul><p>This device does not write ADC Output Patterns to the Cell Voltage, Auxiliary, or Status Registers when a self test is commanded.<br>Default value: 0</p></td></tr><tr><td><strong>Vref2</strong></td><td>Input</td><td>Decimal</td><td>V</td><td>Emulates the V<sub>REF2</sub> pin of a real device.<br>Default value: 0</td></tr><tr><td><strong>Vreg</strong></td><td>Input</td><td>Decimal</td><td>V</td><td>Emulates the V<sub>REG</sub> pin of a real device.<br>Default value: 0</td></tr><tr><td><strong>Vregd</strong></td><td>Input</td><td>Decimal</td><td>V</td><td>Emulates the V<sub>REGD</sub> pin of a real device.<br>Default value: 0</td></tr><tr><td><strong>Internal Die Temperature</strong></td><td>Input</td><td>Decimal</td><td>°C</td><td>Emulates the Internal Die Temperature Measurement on the device, in degrees Celsius. The Internal Die Temperature is subsequently used to calculate the ITMP value stored in Status Register Group A.<br>Default value: 0</td></tr><tr><td><strong>Sum of Cells</strong></td><td>Input</td><td>Decimal</td><td>V</td><td>Emulates the Sum of All Cells Measurement on the device, in degrees Celsius. The Sum of All Cells is subsequently used to calculate the SC value stored in Status Register Group A.<br>Default value: 0</td></tr><tr><td><strong>Cell Measurement </strong><em><strong>x</strong></em></td><td>Input</td><td>Decimal</td><td>V</td><td>Emulates the cell voltage measurement of Cell <em>x</em>. This measurement is taken between pin C<em>x</em> and pin C(<em>x</em>-1) on a real device.<br>Default value: 0</td></tr><tr><td><strong>GPIO </strong><em><strong>x</strong></em></td><td>Input</td><td>Decimal</td><td>V</td><td>Emulates pins GPIO1 through GPIO9 of a real device.<br>Default value: 0</td></tr><tr><td><strong>Open Wire GPIO</strong><em><strong>x</strong></em></td><td>Input</td><td>Binary</td><td> </td><td><p>Emulates an open wire on a GPIO line of the emulated device.</p><ul><li><strong>0</strong> - Uninterrupted connection at pin GPIO<em>x</em>.</li><li><strong>1</strong> - Open wire at pin GPIO<em>x</em>.</li></ul><p>Default value: 0</p></td></tr><tr><td><strong>Open Wire C</strong><em><strong>x</strong></em></td><td>Input</td><td>Binary</td><td> </td><td><p>Emulates an open wire between the external cells. This open wire condition can be detected using the ADOW command.</p><ul><li><strong>0</strong> - Uninterrupted connection at pin C<em>x</em>.</li><li><strong>1</strong> - Open wire at pin C<em>x</em>.</li></ul><p>Default value: 0</p></td></tr><tr><td><strong>STCOMM Reply Command</strong></td><td>Input</td><td>Hexadecimal</td><td> </td><td><p>When the STCOMM command is received from the SPI Master, the value of this channel is written to the COMM register of the emulated device. Map the command communication interface of an external device model, acting as an I<sup>2</sup>C or SPI slave, to this input channel.</p><p>To set the <strong>Default Value</strong> of this channel in the system definition, convert it to decimal notation. </p><p>See <a href="https://www.opal-rt.com/docs/cmde-add-on/model-and-simulation/configure-devices-within-a-ring/manage-hexadecimal-and-binary-data-in-veristand-channels.md"><strong>Manage Hexadecimal and Binary Data in VeriStand Channels</strong></a> for more information.<br>Default value: 0</p></td></tr><tr><td><strong>STCOMM Reply Data</strong></td><td>Input</td><td>Hexadecimal</td><td> </td><td><p>When the STCOMM command is received from the SPI Master, the value of this channel is written to the COMM register of the emulated device. Map the data communication interface of an external device model, acting as an I<sup>2</sup>C or SPI slave, to this input channel.</p><p>To set the <strong>Default Value</strong> of this channel in the system definition, convert it to decimal notation. See <strong>Manage Hexadecimal and Binary Data in VeriStand Channels</strong> for more information.<br>Default value: 0</p></td></tr><tr><td><strong>Last Command Received</strong></td><td>Output</td><td>Hexadecimal</td><td> </td><td>Outputs the last command received from the SPI Master.<br>Default value: 0</td></tr><tr><td><strong>Command CRC Check</strong></td><td>Output</td><td>Binary</td><td> </td><td><p>Binary flag indicating a Command CRC mismatch in the last transmission received from the SPI Master.</p><ul><li><strong>0</strong> - No CRC mismatch detected.</li><li><strong>1</strong> - CRC mismatch detected.</li></ul><p>Default value: 0</p></td></tr><tr><td><strong>Data CRC Check</strong></td><td>Output</td><td>Binary</td><td> </td><td><p>Binary flag indicating a Data CRC mismatch in the last transmission received from the SPI Master.</p><ul><li><strong>0</strong> - No CRC mismatch detected.</li><li><strong>1</strong> - CRC mismatch detected.</li></ul><p>Default value: 0</p></td></tr><tr><td><strong>PWM Discharge Control </strong><em><strong>x</strong></em></td><td>Output</td><td>Binary</td><td> </td><td>Outputs the duty cycle of the PWM controlling the balancing switch for cell C<em>x</em>. The value is represented in 4-bit binary format and corresponds to the PWMC Setting. This channel can be mapped to the input of an external cell model to regulate its discharge process.<br>Default value: 0</td></tr><tr><td><strong>Discharge Cell </strong><em><strong>x</strong></em></td><td>Output</td><td>Binary</td><td> </td><td><p>Binary flag outputting the status of DCC bit x in Configuration Register Groups A and B.</p><ul><li><strong>0</strong> - DCC bit is not asserted.</li><li><strong>1</strong> - DCC bit is asserted.</li></ul><p>Default value: 0</p></td></tr><tr><td><strong>WRCOMM Command</strong></td><td>Output</td><td>Hexadecimal</td><td> </td><td>Outputs the command stored in the COMM register as a result of the latest WRCOMM command received from the SPI Master. Map this channel to the input of an external device model acting as an I<sup>2</sup>C or SPI slave.<br>Default value: 0</td></tr><tr><td><strong>WRCOMM Data</strong></td><td>Output</td><td>Hexadecimal</td><td> </td><td>Outputs the data stored in the COMM register as a result of the latest WRCOMM command received from the SPI Master. Map this channel to the input of an external device model acting as an I<sup>2</sup>C or SPI slave.<br>Default value: 0</td></tr></tbody></table>

## SPI Mode <a href="#spi-mode" id="spi-mode"></a>

The SPI Mode of the LTC6813 device is statically set to SPI Mode 3, where the both the Clock Polarity (CPOL) and the Clock Phase (CPHA) are 1.

## Supported Commands <a href="#supported-commands" id="supported-commands"></a>

The LTC6813 device supports the following SPI commands:

| Commands     | Description                                                                                                                                                                                                                                                                                                                                                                         |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **WRCFGA**   | Write Configuration Register Group A                                                                                                                                                                                                                                                                                                                                                |
| **WRCFGB**   | Write Configuration Register Group B                                                                                                                                                                                                                                                                                                                                                |
| **RDCFGA**   | Read Configuration Register Group A                                                                                                                                                                                                                                                                                                                                                 |
| **RDCFGB**   | Read Configuration Register Group B                                                                                                                                                                                                                                                                                                                                                 |
| **RDCVA**    | Read Cell Voltage Register Group A                                                                                                                                                                                                                                                                                                                                                  |
| **RDCVB**    | Read Cell Voltage Register Group B                                                                                                                                                                                                                                                                                                                                                  |
| **RDCVC**    | Read Cell Voltage Register Group C                                                                                                                                                                                                                                                                                                                                                  |
| **RDCVD**    | Read Cell Voltage Register Group D                                                                                                                                                                                                                                                                                                                                                  |
| **RDCVE**    | Read Cell Voltage Register Group E                                                                                                                                                                                                                                                                                                                                                  |
| **RDCVF**    | Read Cell Voltage Register Group F                                                                                                                                                                                                                                                                                                                                                  |
| **RDAUXA**   | Read Auxiliary Register Group A                                                                                                                                                                                                                                                                                                                                                     |
| **RDAUXB**   | Read Auxiliary Register Group B                                                                                                                                                                                                                                                                                                                                                     |
| **RDAUXC**   | Read Auxiliary Register Group C                                                                                                                                                                                                                                                                                                                                                     |
| **RDAUXD**   | Read Auxiliary Register Group D                                                                                                                                                                                                                                                                                                                                                     |
| **RDSTATA**  | Read Status Register Group A                                                                                                                                                                                                                                                                                                                                                        |
| **RDSTATB**  | Read Status Register Group B                                                                                                                                                                                                                                                                                                                                                        |
| **WRSCTRL**  | Write S Control Register Group                                                                                                                                                                                                                                                                                                                                                      |
| **WRPWM**    | Write PWM Register Group                                                                                                                                                                                                                                                                                                                                                            |
| **WRPSB**    | Write PWM/S Control Register Group B                                                                                                                                                                                                                                                                                                                                                |
| **RDSCTRL**  | Read S Control Register Group                                                                                                                                                                                                                                                                                                                                                       |
| **RDPWM**    | Read PWM Register Group                                                                                                                                                                                                                                                                                                                                                             |
| **RDPSB**    | Read PWM/S Control Register Group B                                                                                                                                                                                                                                                                                                                                                 |
| **CLRSCTRL** | Clear S Control Register Group                                                                                                                                                                                                                                                                                                                                                      |
| **ADCV**     | Start Cell Voltage ADC Conversion and Poll Status                                                                                                                                                                                                                                                                                                                                   |
| **ADOW**     | Start Open Wire ADC Conversion and Poll Status                                                                                                                                                                                                                                                                                                                                      |
| **CVST**     | <p>Start Self Test Cell Voltage Conversion and Poll Status</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>No ADC Output Pattern is written to the Cell Voltage Registers as a result of this command. If the <strong>Selftest Fault</strong> channel is enabled (1) when this command is received, the MUXFAIL bit is set to 1.</p></div> |
| **ADOL**     | Start Overlap Measurements of Cell 7 and Cell 13 Voltages                                                                                                                                                                                                                                                                                                                           |
| **ADAX**     | Start GPIOs ADC Conversion and Poll Status                                                                                                                                                                                                                                                                                                                                          |
| **ADAXD**    | Start GPIOs ADC Conversion with Digital Redundancy and Poll Status                                                                                                                                                                                                                                                                                                                  |
| **AXOW**     | Start GPIOs Open Wire ADC Conversion and Poll Status                                                                                                                                                                                                                                                                                                                                |
| **AXST**     | <p>Start Self Test GPIOs Conversion and Poll Status</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>No ADC Output Pattern is written to the Auxiliary Registers as a result of this command. If the <strong>Selftest Fault</strong> channel is enabled (1) when this command is received, the MUXFAIL bit is set to 1.</p></div>           |
| **ADSTAT**   | Start Status Group ADC Conversion and Poll Status                                                                                                                                                                                                                                                                                                                                   |
| **ADSTATD**  | Start Status Group ADC Conversion with Digital Redundancy and Poll Status                                                                                                                                                                                                                                                                                                           |
| **STATST**   | <p>Start Self Test Status Group Conversion and Poll Status</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>No ADC Output Pattern is written to the Status Registers as a result of this command. If the <strong>Selftest Fault</strong> channel is enabled (1) when this command is received, the MUXFAIL bit is set to 1.</p></div>       |
| **ADCVAX**   | Start Combined Cell Voltage and GPIO1, GPIO2 Conversion and Poll Status                                                                                                                                                                                                                                                                                                             |
| **ADCVSC**   | Start Combined Cell Voltage and SC Conversion and Poll Status                                                                                                                                                                                                                                                                                                                       |
| **CLRCELL**  | Clear Cell Voltage Register Groups                                                                                                                                                                                                                                                                                                                                                  |
| **CLRAUX**   | Clear Auxiliary Register Groups                                                                                                                                                                                                                                                                                                                                                     |
| **CLRSTAT**  | Clear Status Register Groups                                                                                                                                                                                                                                                                                                                                                        |
| **PLADC**    | Poll ADC Conversion Status                                                                                                                                                                                                                                                                                                                                                          |
| **WRCOMM**   | Write COMM Register Group                                                                                                                                                                                                                                                                                                                                                           |
| **RDCOMM**   | Read COMM Register Group                                                                                                                                                                                                                                                                                                                                                            |
| **STCOMM**   | Start I2C/SPI Communication                                                                                                                                                                                                                                                                                                                                                         |
| **MUTE**     | Mute Discharge                                                                                                                                                                                                                                                                                                                                                                      |
| **UNMUTE**   | Unmute Discharge                                                                                                                                                                                                                                                                                                                                                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/cmde-add-on/model-and-simulation/configure-devices-within-a-ring/device-section/ltc6813.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
