Datasheet map¶
The driver follows the PCA9685 datasheet. This page says which revision, where to get it, and where each part of the driver is described in it, so you can check any behaviour against the source. Section names and page numbers are the datasheet's own (the printed page numbers).
- Datasheet: PCA9685 16-channel, 12-bit PWM Fm+ I2C-bus LED controller, NXP PCA9685, revision Rev. 4 (2015-04-16).
Get it from the vendor page or as a
PDF.
SHA-256 of the file used:
237d47f339cac4c3a0d56a5f0b4d3c93df71e3eb43f36ac57ea4ff38e6b2e585.
| Topic | Datasheet section | Page | In the driver | Explained on |
|---|---|---|---|---|
| Pins and packages (TSSOP28, HVQFN28) | 6 Pinning information; Table 3 Pin description | p. 6 | CtrlPin::OutputEnable |
Hardware, Quickstart |
| Slave address, A0 to A5 | 7.1.1 Regular I2C-bus slave address; Figure 4 | p. 7 | kI2cAddress, kMinI2cAddress, kMaxI2cAddress, Error::InvalidArgument |
Hardware, Porting, Troubleshooting |
| LED All Call and Sub Call addresses | 7.1.2 LED All Call I2C-bus address; 7.1.3 LED Sub Call I2C-bus addresses | p. 8 | kAllCallAddress, MODE1.ALLCALL and SUB1 to SUB3 cleared by EnsureInitialized() |
Hardware, Contract |
| Software Reset address | 7.1.4 Software Reset I2C-bus address | p. 9 | (not sent by the driver; its effect is found by CheckForReset()) |
Hardware |
| Control register | 7.2 Control register | p. 9 | pca9685::reg (inc/pca9685_registers.hpp) |
Architecture |
| Register summary and auto-increment | Table 4 Register summary | p. 10 | pca9685::reg, MODE1.AI set by EnsureInitialized(), bursts of up to 64 bytes |
Architecture, Contract |
| MODE1, sleep, EXTCLK and the oscillator start-up | 7.3.1 Mode register 1, MODE1; Table 5 | p. 14 | EnsureInitialized(), Sleep(), Wake(), kOscillatorStartUs, Config::clock, Error::ExternalClockLatched |
API guide, Configuration, Contract |
| Restart mode | 7.3.1.1 Restart mode | p. 15 | Sleep(SleepMode::HoldOutputs), Wake(), SetPwmFrequency(), Error::Asleep |
API guide, Contract |
| MODE2, output drive, inversion, change on STOP, OUTNE | 7.3.2 Mode register 2, MODE2; Table 6 | p. 16 | Config::output_drive, Config::invert_outputs, detail::Mode2Value() |
Configuration, Hardware, Contract |
| LED output and PWM control, full ON and full OFF | 7.3.3 LED output and PWM control; Table 7; Figure 9 | p. 16 | Pwm, PwmForDuty(), SetPwm(), SetDuty(), SetFullOn(), SetChannelOff(), SetChannels() |
API guide, Architecture |
| ALL_LED registers and the orderly shutdown | 7.3.4 ALL_LED_ON and ALL_LED_OFF control; Table 8 | p. 25 | SetAllOff(), Sleep(SleepMode::OutputsOff), EnsureInitialized(), Deinitialize() |
API guide, Contract |
| PWM frequency, PRE_SCALE | 7.3.5 PWM frequency PRE_SCALE; Equation 1 | p. 25 | PrescaleFor(), FrequencyFor(), CountsForPulseUs(), SetPwmFrequency(), SetPulseWidthUs(), Validate() |
Configuration, API guide |
| SUBADR1, the reset sentinel | 7.3.6 SUBADR1 to SUBADR3; Table 9 | p. 26 | detail::kSubAdr1Sentinel, written by EnsureInitialized(), read by every reset check |
Contract |
| Output enable, OE | 7.4 Active LOW output enable input; Table 11 | p. 27 | DisableOutputs(), EnableOutputs(), detail::OffLevelOutne() |
Hardware, Porting, Contract |
| Power-on reset | 7.5 Power-on reset | p. 27 | CheckForReset(), Error::DeviceReset, the reset sentinel MODE1.AI |
Contract, Troubleshooting |
| Software reset by the general call | 7.6 Software reset | p. 28 | CheckForReset(), Error::DeviceReset |
Contract, Troubleshooting |
| External drivers, INVRT and OUTDRV | 7.7 Using the PCA9685 with and without external drivers; Table 12; Figures 13 to 15 | p. 29 | DirectLedPreset(), ServoPreset(), Config::invert_outputs, Config::output_drive |
Hardware, Configuration |
| I2C bus transactions | 9 Bus transactions; Figures 20 to 24 | p. 32 | I2cInterface, I2cPort, kRepeatedStart, every register access |
Porting, Architecture |
| Typical application | 10 Application design-in information; Figure 26 | p. 35 | - | Hardware |
| Supply, power-on reset voltage and output currents | 11 Limiting values; 12 Static characteristics | p. 38 | - | Hardware |
| I2C timing, EXTCLK and OE propagation | 13 Dynamic characteristics; Table 15 | p. 40 | kMaxClockHz, kMaxOscillatorHz, DisableOutputs() |
Hardware, Porting |
When the datasheet and the driver differ¶
The driver is written against the revision above. If you have a newer revision, compare its revision history with the topics above; a change to a pin, a register, a timing or a value the driver uses is a bug report for this repository. Where the driver deliberately goes beyond the datasheet, the Contract says so.
The repository never contains the PDF itself: vendors own their documents. Download it from the vendor, and compare its SHA-256 with the one above to confirm you have the same file.