-
Notifications
You must be signed in to change notification settings - Fork 0
I2C Port Expander Support
intermittech edited this page Jul 15, 2026
·
1 revision
Select the expander type in the usermod settings (or at compile time, see below). Relays are attached to expander ports using virtual pin numbers starting at 100:
| Expander | Ports | Virtual pins | I2C addresses |
|---|---|---|---|
| PCF8574 | 8 (P0-P7) | 100-107 | 0x20-0x27 (PCF8574A: 0x38-0x3F) |
| AW9523 | 16 (P0_0-P0_7, P1_0-P1_7) | 100-107 (P0_x), 108-115 (P1_x) | 0x58-0x5B (AD1/AD0 straps) |
After changing the expander type, save and re-open the Usermods settings page so the pin dropdowns show the matching port names. With no expander selected (None), no expander ports are offered in the pin dropdowns.
- The chip is verified via its ID register at boot; the Info page shows whether it was found.
- Only the ports assigned to relays are (re)configured (GPIO mode, output direction, interrupts masked) - other ports of the chip are left untouched, so they remain available for other purposes.
- The P0_x port is open-drain by default in hardware. The usermod configures it as push-pull by default (recommended when driving relay/optocoupler inputs directly). Untick
AW9523-pushpull(or set-D AW9523_P0_PUSHPULL=false) if your board relies on open-drain outputs with external pull-ups. P1_x is always push-pull. - The RSTN pin of the AW9523 has an internal 100k pull-down - it must be tied high (to VCC) on the board or the chip stays in reset.
This page is generated from the usermod's in-tree readme (usermods/PowerManager/readme.md) by sync_wiki.py - edit there, not here.