Adding additional output ports
RepRapFirmware 1.19 and later for the Duet 2 support expansion of the number of output ports by using an SX1509B chip attached to the I2C bus. This facility is available whether or not you have a Duex 2 or Duex 5 expansion board connected to your Duet.
You can buy expansion boards based on the SX1509 from Sparkfun and on eBay.
You must configure the expansion board so that the SX1509B chip is at I2C address 0x71. This is achieved by connecting the two ADDR inputs of the SX1509B chip to Vcc (logic level 1) instead of to ground (logic level 0). Expansion boards based on the SX1509B normally have a traces that can be cut and solder pads that case be bridged to achieve this.
The logical pin numbers to address the SX1509B outputs in M42, M208 and M670 commands are 120 through 135.