Display, PWM & Haptics

# NXP Semiconductors PCA9685 digital twin

16-channel, 12-bit Fm+ I2C PWM LED and servo controller.

standing: provisional I2C (I2C1 on nucleo-f767zi) 0x40–0x7F (default 0x40)

Vendor NXP Semiconductors Display, PWM & Haptics

Interface I2C 0x40–0x7F (default 0x40)

Record Status 2026-11-21 rev 287d49a4a (clean tree)

## Driver oracle & capability record

Driver oracle PASS: 7/7 stages passed on nucleo-f767zi; generator 0.1.0+policy.12.

| Driver reference         | [libdriver/pca9685 driver (commit 592c8ee64)](https://github.com/libdriver/pca9685) (MIT)                                                       |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Evidence standing        | provisional (register and bus behavior derived from vendor datasheet or driver oracle; not yet hardware-unit verified on two physical samples). |
| Datasheet accuracy basis | 12-bit counter, one count (0.024 %); PRE\_SCALE = round(25 MHz / (4096 x f)) - 1 (PCA9685 Rev. 4)                                               |
| Negative control         | part at address 0x41 instead of 0x40 -> oracle FAIL                                                                                             |
| Published record         | [accuracy/driver-oracles-2026-11-21.json](https://circuittwin.ai/evidence/accuracy/driver-oracles-2026-11-21.json) (SHA-256 dd20a19b84c9)       |

## Measured driver round-trip results

| Quantity      | Measured | Expected | Error   | Datasheet Tolerance |
| ------------- | -------- | -------- | ------- | ------------------- |
| FREQUENCY\_Hz | 50 Hz    | 50 Hz    | 0 Hz    | ±1 Hz               |
| DUTY\_m%      | 24975 m% | 25000 m% | \-25 m% | ±25 m%              |

## Key registers & reset values

| Address / Field | Register     | Reset / Expected | Purpose                                              |
| --------------- | ------------ | ---------------- | ---------------------------------------------------- |
| 0x00            | MODE1        | 0x11             | RESTART, register auto-increment and SLEEP control   |
| 0x01            | MODE2        | 0x04             | Output drive (totem-pole / open-drain) and inversion |
| 0x06–0x45       | LEDn\_ON/OFF | 12-bit ticks     | Per-channel ON/OFF counter thresholds                |
| 0xFE            | PRE\_SCALE   | 0x1E (200 Hz)    | PWM frequency divider round(25 MHz / (4096\*f)) - 1  |

## Attach with ct CLI

Shell - run firmware with PCA9685

```
# Run compiled firmware with PCA9685 attached on nucleo-f767zi
ct run --json --board nucleo-f767zi --device pca9685 build/app.elf

# Run fault-injection suite and emit JUnit XML
ct test run --json --junit results/pca9685.xml tests/pca9685-fault.suite.yaml
```

## Fault-injection test snippet (suite.yaml)

tests/pca9685-fault.suite.yaml

```
version: 1
board: nucleo-f767zi
firmware: build/app.elf
tests:
  - name: pca9685-i2c-nack-and-bad-id
    faults:
      - at_ms: 30
        bus: I2C1
        kind: nack
        address: 0x40
        count: 2
      - at_ms: 150
        part: pca9685
        kind: register_override
        register: 0x00
        value: 0xFF
    expect:
      console_contains: "DRIVER_FAULT_DETECTED"
      exit_code: 0
```

## Compatible board twins

[Board: nucleo-f767zi](https://circuittwin.ai/boards/nucleo-f767zi) [Board: stm32f4-discovery](https://circuittwin.ai/boards/stm32f4-discovery) [Board: teensy-4-1](https://circuittwin.ai/boards/teensy-4-1) [Accuracy report](https://circuittwin.ai/docs/accuracy)

## More in Display, PWM & Haptics

[DRV2605 (Texas)](https://circuittwin.ai/twins/drv2605) [HT16K33 (Holtek)](https://circuittwin.ai/twins/ht16k33) [ILI9341 (Ilitek)](https://circuittwin.ai/twins/ili9341) [MAX7219 (Analog)](https://circuittwin.ai/twins/max7219) [SSD1306 (Solomon)](https://circuittwin.ai/twins/ssd1306) [ST7789 (Sitronix)](https://circuittwin.ai/twins/st7789)

> ## Inject PCA9685 bus faults in CI
>
> Wire PCA9685 onto your MCU board twin, drive physical stimuli and fail builds when your driver hangs on NACKs or frozen registers.
>
> [Start now](https://app.circuittwin.ai/try) [Inputs & fault injection docs](https://circuittwin.ai/docs/inputs) [Connect a coding agent](https://circuittwin.ai/docs/agents)
