Adding a second strips of neo pixels?
-
I have an strip of 20 neo pixles that are connected to a Mini5 with three wires and used to illuminate the printer chamber. It works well.
Now I would like to add a second strip of 3 neopixels on the head (for the upcoming new Voron head design), ideally using only 3 wires going to each strip (that is, no daisy chain).
Any suggestion on how to do that? Is there a second neopixel port? Adding dummy neo pixels as delay? Anything else?
-
@zapta I don't think there is. I suppose it'd be technically possible, if you changed the code to use another output, the neopixel output is very similar to the other outputs (with an additional resistor) .
Is that a new afterburner head? Where did you see that?
-
@th0mpy , I was thinking, maybe adding hidden 3 Neo pixels as a delay, achieving a virtual chain of 3 + 20, without having to daisy chain them (see diagram below). Do you think this will work? I don't know what is the fan out of the Duet's output.
As for new head, I recommend watching this video https://youtu.be/lnMJBdUXuH4 , all coming soon.
BTW, the two nozzle nozzle pixels should also work well with a nozzle camera like this one https://www.youtube.com/watch?v=GAp23w_dnNc . I already damaged the first cam. Second one arrived today from Amazon
-
@zapta That looks cool! Too bad it looks like I won't be able to use my LGX (as it looks). We'll see I guess.
I suppose your idea about a few dummy LEDs might work, I'm not familiar enough with how they work yet but I have a string of them that I will put into my printer eventually. Let me know if that works for you, I'd be interested to see what you come up with.
-
@zapta said in Adding a second strips of neo pixels?:
Is there a second neopixel port?
On the Mini5+ are two NP-ports: one regular and the other goes to 12864LCDs. Not sure which pin it is or if the LED on the display is controlled by the display itself (the data sent wrapped in the LCD data stream?)
Nevertheless, the STM-port of RRF allows you to define any pin as NeoPixel port. @gloomyandy @jay_s_uk , please correct me if I'm wrong.
It would be cool, if that (*) would be implemented into the main-port. *) the whole board.txt thing is worth pulling) -
@zapta there are two Neopixel outputs on the Mini. One is the dedicated port and is driven by DMA. The other is intended for the 12864 display and is driven by bit banging. If you don't have a 12864 display connected then you could use that one.
Another possibility is to use an external gate to switch the main output between the two strings
-
@dc42
..what a coincidence, we wrote almost the same. Please comment on the STM-branch pull-request -
@o_lampe The board.txt mechanism is not really ideal, it is there mainly to avoid having to have multiple builds for boards that are basically very similar. Although it provides that flexibility it also adds a potential source of error that the Duet boards do not have (it is fairly common for folks to get the board.txt settings wrong).
In this case I'd say it is not the best solution. Rather something like an extension of the existing RRF mechanisms would be better, we already have ways to define a pin for something like a heater port or fan control, I would have thought this same system could be used to define an LED port. That way a user can simply use gcode to define the pin(s) to be used.
-
@gloomyandy @dc42
I agree that RRF3 has offered a new flexibility regarding pin/port definitions. The NeoPixel implementation doesn't allow that for the benefit of DMA, but the bit banging versions should allow "free" choice of pin(s).
And while we are talking about bit banging: why not implement a SW-SPI or SW-UART port?
There are so many things happening outside of the actual print-time, where we could use the MCU effectively instead of sitting idle. -
@dc42 said in Adding a second strips of neo pixels?:
The other is intended for the 12864 display and is driven by bit banging
I set the colors every 10 secs in the daemon.g file. What are the implications of using a bit banging output with 25 neo pixels? Does it occupy the CPU 100% for the duration of the transmission? Will this interfere with normal printing?
(Most of my neo pixels updates are no change so I guess I could skip them using some global variable that keeps the last updated state but it's extra complexity and will not recover fast from update errors)
-
@zapta said in Adding a second strips of neo pixels?:
Does it occupy the CPU 100% for the duration of the transmission? Will this interfere with normal printing?
Yes and yes. That's why if you want to update both LED strings during a print, it would be better to use an external gate so that you can drive both strings from the DMA-driven channel. You will need a 74HCT02 IC and a spare IOx_OUT pin.
-
Thanks @dc42, I will stay with DMA only then.
What do you think about the topology here https://forum.duet3d.com/topic/26347/adding-a-second-strips-of-neo-pixels/2?_=1639426715611 ? Using three helper neo pixels near the duet to simulate a single 3 + 20 neo pixel string without using a daisy chain?
The neo pixel data output seems to drive 50ma so probably good enough to drive a ~150cm wire to the 20 neo pixels string. https://cdn-shop.adafruit.com/product-files/1138/SK6812+LED+datasheet+.pdf
-
-
@zapta how often will you change the colours on the strip of 3? If it's only occasionally then you could use the bit-bang channel for them.
-
@dc42 said in Adding a second strips of neo pixels?:
@zapta how often will you change the colours on the strip of 3? If it's only occasionally then you could use the bit-bang channel for them.
I update every 10 secs but the color actually changed when the printer changes state (printing, cooling, idle, etc) so very seldom if I will skip the no change updates.
-
@zapta in that case you should be good to use the bit bang channel for that. The main limitation of the bit bang channel is that if you use M150 on it, it will ask the movement system to come to a stop, then when it does it will halt the system for up to about 200us while it executes the command, then it will restart movement.
-
Thans @dc42 , I will give it a try. I presume I need to add a 5v level shifter for the secondary neopixel output I will use.
-
@zapta said in Adding a second strips of neo pixels?:
Thans @dc42 , I will give it a try. I presume I need to add a 5v level shifter for the secondary neopixel output I will use.
Yes, you will.