Site Navigation

Your Account

Choose Language

Using servos and controlling unused IO pins

RepRapFirmware allows you to connect other devices to outputs that are not required for their primary purpose. The DueX2 and DueX5 expansion boards for the Duet WiFi and Duet Ethernet also provide additional outputs.

Starting with firmware version 1.16, pin numbers in the M42 command are logical pin numbers as listed below, not Arduino-like pin numbers. The M280 servo control command uses a subset of the same pin numbers.

To see where these pins are on the 2nd Generation Duets, see the Duet wiring diagrams

Logical pin numbers ¶ 

Note that these logical pin numbers are not the physical pin numbers on the expansion header, or the internal pin numbering within the firmware.

Pin numbersUsual functionPWM capable?Usable for servos?Notes
0-7Heaters 0-7yesyesDisable the heater using M307 H# A-1 C-1 D-1 to make the pin available, where # is the heater number, and make sure that no tool is configured to use that heater. The outputs on the expansion connector are active low with 3.3V signal level. On the DueX5 expansion board, heater channels 3-7 are available as 5V active-high signals on the PWM1 - PWM5 connectors respectively. On the DueX2, heater channels 3-5 are available on PWM1 - PWM3. Caution: the heater output terminals will also be driven by the PWM signal or servo pulses.
20-27Fans 0-7yes20-22 onlyDisable the fan using M106 P# I-1 to make the pin available, where # is the fan number. Fans 3-7 are on the DueX5 and DueX2 expansion boards.
40-49Endstop connectors 0-9nono40-44 are input only, 45-49 are input/output. On the Duet WiFi and Duet Ethernet, 45-49 are the endstop connectors on the DueX5 expansion board. On the Duet 0.6 and 0.8.5, 45-48 are the endstop inputs on the expansion connector.
60-Miscellaneous pinsnonoThe pins available depend on which Duet you have - see below
100-103GPIO pins 1-4yesnoThese are on the DueX2 and DueX5 expansion boards

Board dependencies ¶ 

Duet WiFi and Duet Ethernet ¶ 

The miscellaneous pin numbers 60-63 correspond to the CS5-CS8 pins on the expansion connector. These were originally allocated for use as the E2-E6 endstop pins and are labelled as such on the expansion connector, but they are now used to address thermocouple and RTD daughter boards on a DueX2 or DueX5 instead. Because most users don't need more than the four thermocouple and RTD channels supported on the Duet WiFi, we make CS5-8 available as general purpose I/O if you do not have any daughter boards fitted to the DueX2/X5. Here is the mapping between pin numbers, signal names, and the labels on the expansion connector:

Logical pinSignal nameExpansion connector labelExpansion connector pin number

Duet 0.6 and 0.8.5 ¶ 

The mapping between logical pin numbers for miscellaneous pins and the corresponding signal names on the expansion connector is as follows.

Logical pin numberExpansion connector signal name
67PB16/DAC1 (also used as CS signal on external SD card socket)


Add Comment

View Statistics:

Past 24 Hours: 16

Past 7 Days: 62

Past 30 Days: 287

All Time: 594