I was hoping to get some help getting some RGBW TM1814 pixel LED's running on an Arduino Uno.
I've tried multiple libraries from the Adafruit neopixel library and varying FastLED RGBW capable forks and the main FastLED Library.
from what I understand from reading the datasheets on for the TM1814 (here) and the adafruit RGBW neopxiel (or SK6812 here) the timings are pretty close except for the TReset which I believe might be the cause of my problems.
I have also tried other dev boards, the teensy 3.5 and sparkfun ESP32 thingplus with 3.3v - 5v logic level circuits with no luck.
If anyone could point out something I might've missed or has had some previous success with this chip and can shed some light it would be fantastic.
No I haven't I'm still a bit new to all of this how would I go about that?
EDIT
I've tried a couple of different ideas such as using logic gates, particularly a nand gate with both inputs tied to the sing output pin of my arduino with no success.
So I'm still yet to get anything to really work as of yet.
I've tried using NAND gates to invert the signal and running the Adafruit Neopixel library with RGBW.
I've tried adjusting the PWM clock and resolution to hit 1000Hz
I now definitely feel like the problem lies in the data transmission timings.
If anyone with the know how to adjust the timings of the signals sent could guide me in the right direction that would be great.
I've linked the library here
Another quick little update.
I finally got an email back from the supplier with some sample code for what appears to be a STC15W104 MCU.
here is the code:
Unless you have an oscilloscope then forget it. That uses a bit of machine code to make the timing and you will have to convert that to Arduino’s machine code. Basically that is what the two WS2812 libraries do and if it is the timing that is off your best bet is hacking one of the two libraries to tweak the timing.
But without an oscilloscope to measure what you get you are just working in the dark.
I'm definitely feeling the Oscilloscope would be the best method, I'm trying to get my hands on one.
In the mean time I guess I'll continue my to bang my head on the wall with some trial and error ;).
I'm continuing to try and hack the neopixel library.
Surely though I should be able to at least narrow it down. if the Data Rate IN for the chip is 800Khz should I match the PWM frequency to this? The teensy has a default PWM frequency of 488.28Hz. Then according to the PJRC website when The chip is run at 120MHz clock the PWM signal is 915.527Hz. the PWM signal can be adjusted using code;
void setup() {
analogWriteFrequency(PIN, FREQUENCY);
analogWriteResolution();//number of bits
}
the code from the adafruit library that i'm using seems to be this section:
it appears to me that by adjusting adjusting the value after F_CPU I should be able to adjust the timings but I have no clue what F_CPU is. the other part of the equation is the Reset timing which I'm assuming is the
while(ARM_DWT_CYCCNT - cyc < CYCLES_800);
I'm also confused as to where ARM_DWT_CYCCNT variable comes from, this is the first time it appears in the entire code and what the use of the variable mask in the code is.
I'm also confused as to where ARM_DWT_CYCCNT variable comes from
It must be defined in a .h file somewhere. Maybe in the ARM support files.
what the use of the variable mask in the code is.
That sort of thing is called a “walking one” it goes through all the bits in the variable one at a time. It is then used to decide what sort of pulse is produced for the information in that bit. It is a standard technique when you want to do something depending on the state of bits in a variable.
I finally got my hands on an oscilloscope today and got the LED's working!
So it was a timing issue with the total run time being too short originally for the tm1814 chip which lead to a misread of the 0 and 1 timings.
These timings work:
Keeping in mind the closer to 1100000 the more chance of flicker.
I also had to modify the way the constant current frames (C1 and C2) were stored and output by the code. I modified the setPixelColor function to accept the C1 and C2 and store them in the pixel buffer. I've attached the modified Neopixel.cpp and Neopixel.h files for anyone who might stumble across this.
I'm going to continue playing around with this and slowly optimising it but for now I'm going to move on with the rest of the project.
I see it has been a couple of months since your last post. I have been looking for a way to use TM1814. I am curious if you have made any more progress. It would be really cool if support could make its way back to WLED.
I've had the TM1814 working on the Teensy3.5 for the since this post. As for progress I have them runnings on a teensy and I'm currently trying to get them to work with serial communications either through non blocking code or some other means of transmitting data. To get support on WLED you might have to look into that yourself as I'm unfamiliar with that library.