Skip to main content

Site Navigation

Your Account

Choose Language

Help

Revision to Using servos and controlling unused IO pins

Tony

[title|Using servos and controlling unused IO pins]
 
[toc]
 
[summary]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.[/summary]
 
 
 
Starting with firmware version 1.16, pin numbers in the [[Gcode#Section_M42_Switch_I_O_pin|M42 command]] are logical pin numbers as listed below, not Arduino-like pin numbers. The [[Gcode#Section_M280_Set_servo_position|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|Duet wiring diagrams]]
 
== Logical pin numbers ==
 
{table
|! Pin numbers
|! Usual function
|! PWM capable?
|! Usable for servos?
|! Notes
|--
| 0-7
| Heaters 0-7
| yes
| yes
| Disable 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-27
| Fans 0-7
| yes
| 20-22 only
| Disable 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-49
| Endstop connectors 0-9
| no
| no
| 40-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 pins
| no
| no
| The pins available depend on which Duet you have - see below
|--
| 100-103
| GPIO pins 1-4
| yes
| no
| These 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:
 
{table
|! Logical pin
|! Signal name
|! Expansion connector label
|! Expansion connector pin number
|--
| 60
| CS5
| CS5
| 50
|--
| 61
| CS6
| E3_STOP
| 9
|--
| 62
| CS7
| E4_STOP
| 14
|--
| 63
| CS8
| E5_STOP
| 19
}
 
=== 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.
 
{table
|! Logical pin number
|! Expansion connector signal name
|--
| 60
| PA10/RXD0
|--
| 61
| PA11/TXD0
|--
| 62
| PA12/RXD1
|--
| 63
| PA13/TXD1
|--
| 64
| PA14/RTS1
|--
| 65
| PB12/TWD1
|--
| 66
| PB13/TWCK1
|--
| 67
| PB16/DAC1 (also used as CS signal on external SD card socket)
|--
| 68
| PB21/AD14
|--
| 69
| PC4
}