Duet boards support the connection of LEDs, which can be controlled by RepRapFirmware.
If you need more LEDs than are directly supported, there are a couple of other ways to connect LEDs:
Only Duet 3 Mainboard 6HC and 6XD support Dotstar LEDs, and only on the dedicated LED connector. No other Duet boards support Dotstar LEDs. The maximum number of DotStar LEDs supported per strip is several thousand, for all firmware versions (Duet 3 6HC and 6XD only).
All Duet 3 boards support NeoPixel LED strips.
Duet 2 WiFi and Ethernet supports NeoPixel LEDs from RRF 3.3.
Duet 2 Maestro supports NeoPixel LEDs from RRF 3.5. However, it is currently not working correctly (RRF 3.5.2), as the timing is incorrect, so LEDs are not controllable.
The maximum number of Neopixel LEDs supported per strip depends on the firmware version:
RRF 3.5 | RRF 3.4 | RRF 3.3 | RRF 3.2 and earlier | |||||
---|---|---|---|---|---|---|---|---|
RGBW | RGB | RGBW | RGB | RGBW | RGB | RGBW | RGB | |
Duet 3 6HC/6XD | 240 | 320 | 240 | 320 | 80 | 106 | - | 60 |
Duet 3 Mini 5+ | Unlimited* | 80 | 106 | 80 | 106 | - | 60 | |
Duet 3 Expansion & Tool boards | Unlimited* | - | - | - | - | - | - | |
Duet 2 WiFi/Ethernet | Unlimited* | 60 | 80 | - | 60 | - | - | |
Duet 2 Maestro | See below** | - | - | - | - | - | - |
*Limited only by available RAM
**In RRF 3.5, Neopixel support was added for the Duet 2 Meastro. However this has not been tested by Duet3D. The maximum number supported would be limited by available RAM.
The Duet 3 Mainboard 6HC, Duet 3 Mainboard 6XD, Duet 3 Mini 5+ and Duet 2 WiFi/Ethernet have a dedicated LED header. See below how to connect LED strips to these headers.
Connect the LED strips to the 4-pin connector labelled DS_LED.
Caution! LED strips can draw a considerable amount of power, usually up to 60mA per LED (for RGBW Neopixel LEDs, up to 80mA per LED). If you are powering the LED strip from the Duet, make sure that the Duet is able to supply sufficient current (maximum 0.8A total external load on +5V for MB6HC version 1.02 or later, 3A total for other MB6HC/MB6XD boards).
Connect the LED strips to the 3-pin connector labelled NP_LED.
You will need to supply external 5V power to the adjacent 5V_IN connector, unless you connected the 5V line of your LED strip directly to an external 5V supply.
The 5V regulator on the Duet 3 Mini is rated at 1A total and can only power a very small number of LEDs. Note that the 5V_EXT rail is normally isolated from the on-board 5V supply and must be always powered via 5V_EXT_IN.
For control of RGB backlights on 12864 displays, the display's RGB LED data line should be connected to pin 5 of the 12864_EXP1 connector. See Connecting 12864 displays.
Support for NeoPixel strips on Duet 2 WiFi/Ethernet was added in RRF 3.3.
A signal for controlling Neopixel strips can be output on pin 5 of the CONN_LCD connector provided that you do not have external stepper drivers connected to CONN_LCD.
Note that movement will be suspended any time M150 is used to update LEDs. So OK at the start/end of a print, or the end of heating up, but not a good idea during a print. This is because the CONN_LCD port doesn't have hardware DMA support for LEDs, the CPU has to stop all other activity including step pulse generation in order to generate the correct pulses to set the LEDs.
The signal level on pin 5 of the CONN_LCD connector is 3.3V so you may need to level shift it to 5V. You should to do one of the following:
RGB NeoPixels draw up to 60mA per LED. RGBW ones draw up to 80mA per LED. Therefore the Duet cannot provide enough power for an LED strip unless the number of LEDs in the strip is small (for example 16 RGB or 12 RGBW LEDs). For longer strips you must provide external 5V power to the strip.
To control RGB backlights on 12864 displays, see Connecting 12864 displays.
In RRF 3.5 and later, Neopixel LED strips can also be controlled by any pin that can be used as a low voltage digital output, on mainboards or expansion boards; for example an IO#.out port on a Duet 3 series board.
Connect the LED strips as follows:
Dedicated pin | Other pins | |||
---|---|---|---|---|
Pin name | Location | Pin name | Location | |
Duet 3 6HC/6XD | led | D0, DOTSTAR header | IO[X]_out | IO headers |
Duet 3 Mini 5+ | led | D0, NEOPIXEL header | IO[X]_out | IO headers |
Duet 3 Expansion & Tool boards | - | - | IO[X]_out | IO headers |
Duet 2 WiFi/Ethernet | connlcd.5, connlcd.db7, connlcd.np | CONN_LCD pin 5 | any other digital-capable pin | See Pins table |
Duet 2 Maestro | - | - | any other digital-capable pin | See Pins table |
From RRF 3.5.0-beta.4, M950 is used to configure the LED strip. Multiple strips (up to 5) can be configured in M950.
A simple configuration for a single strip might be something like:
; Duet 3 led pin
M950 E0 C"led" T1 Q3000000 ; create a RGB Neopixel LED strip on the LED port and set SPI frequency to 3MHz
; Duet 2 WiFi/Ethernet CONNLCD pin 5
M950 E0 C"connlcd.np" T2 U3 ; create a RGBW Neopixel LED strip with 3 LEDs on CONNLCD pin 5 (will need level shifting from 3.3V to 5V)
For configuring a 12864 display's LEDs on a Duet 3 Mini 5+ 12864_EXP1 connector:
M918 P2 E-4 F2000000 ; Fysetc 12864mini
M950 E1 C"io3.out" T1 U3 ; create a RGB Neopixel LED strip with 3 LEDs on the Duet 3 Mini 5+ 12864_EXP1 header
M150 is used to control the strip.
Control the LED strip using M150:
M150 E0 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow
M150 E0 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming strip
Set the RGB colours of the 12864 display in a similar way:
M150 E1 R0 U0 B255 P255 S1 F1 ; display led blue
M150 E1 R255 U0 B0 P255 S1 F1 ; left encoder led red
M150 E1 R0 U255 B0 P255 S1 F0 ; right encoder led green
In RRF 3.4 and earlier, the M150 command is used both to configure and control LED strips:
Example:
M150 X1 Q3000000 ; set LED type to NeoPixel and set SPI frequency to 3MHz
M150 R255 P128 S20 F1 ; set first 20 LEDs to red, half brightness, more commands for the strip follow
M150 U255 B255 P255 S20 ; set next 20 LEDs to cyan, full brightness, finished programming strip
The X and Q parameters configure them and the remaining parameters set the colours. If the X and Q parameters are not provided, the last values of those parameters specified will be used again, or default parameters if they have never been specified. You do not normally need to specify the Q parameter, but you must specify the X parameter at least once unless the default is acceptable. On the Duet 3 MB6HC the default is X0 (DotStar) in firmware 3.1.1 and earlier, and X1 (RGB Neopixel) in firmware 3.2 and later. On other boards the default is always X1.
If the S parameter is omitted then as many LEDs as can be set in a single chunk will be addressed which depends on the board (e.g. 60 RGBW neopixels on Duet2, many more on Duet 3). We recommend users always explicitly set the number of LEDs to address, rather than rely on this behaviour as the number of LEDs addressed in a single chunk may change in the future.