TM1814 is a four-channel constant current LED driver. Similar to the NeoPixel's WS2812B, TM1814 uses one data line to control a string of daisy chained LEDs.
However, TM1814 is not compatible with the WS2812B, so it needs different software to drive it. Adafruit publishes Adafruit_CircuitPython_TM1814, a software library for CircuitPython that runs on RP2040 and RP2350 microcontrollers, including the Feather RP2040, Feather RP2350, Raspberry Pi Pico, and Raspberry Pi Pico 2.
Key facts about TM1814:
- TM1814 works with LED supply voltages up to 24V, vs about 5V for NeoPixels. A particular LED strip will have a design voltage, often 12V; refer to the LED strip supplier's details and do not exceed them.
- TM1814 often controls more than one LED package. For instance, a 12V strip is likely to have 3 RGBW LEDs for every 1 TM1814. These 3 LEDs will all have the same color and act as a "single pixel" in your code.
- There is an overall LED current control, selectable from 6.5mA to 38mA in 0.5mA steps, that applies to all TM1814 in a strip
- TM1814 is a standalone chip designed for RGBW designs, while WS281x chips are RGB only
- TM1814 will display a test pattern when not actively driven by a microcontroller
- The waveform is very similar to an inverted NeoPixel waveform, but not exactly
Why require RP2040/RP2350
The RP2 "PIO" peripheral can be used to create high precision waveforms constantly, without any intervention needed from your program's main code. The background_write
function of CircuitPython's StateMachine object made this simple to implement. Doing the same thing on another microcontroller family, like ESP32, would have been more complicated and might have required changes in the CircuitPython core.
adafruit_tm1814
library overview
TM1814PixelBackground
is an adafruit_pixelbuf
object and supports all of that object's methods. So, your code can set all the LEDs with a line like pixels.fill((255,0,0))
or set individual pixels with code like pixels[0] = (255,0,0)
. It is also compatible with the extensive set of animations available through the Adafruit LED Animation library.
It also adds functionality specific to TM1814: the current_control
property. The current is settable, per R/G/B/W channel, in the range of 6.5mA to 38mA.
Additionally, the show()
method exists, but does nothing, because the strip is constantly being updated. For similar reasons, the auto_write
property exists, but any value assigned to it is ignored, and the property always reads back as True
.
If you use an inverting signal conditioner between your microcontroller and the TM1814 strip, you can pass inverted=True
to the constructor to give the signal the correct polarity.
You can check the full documentation for adafruit_tm1814
via the link in the sidebar.
Text editor powered by tinymce.