Go Down

Topic: Controlling IC1903 strip with arduino (Read 2821 times) previous topic - next topic

lothas

I just bought an addressable LED strip that uses the TM1903 chip. The strip only has 3 cables: Vin, GND and DI. I connected Vin and GND to the 12V power source and the DI and GND to the arduino. I don't know how to send the 24bit signal to the strip in order to control it. Can anybody help?

Here's the chip:
http://www.szpth.com/p/zl/TM1903.pdf
And this is the strip:
http://www.kutop.com/led-strip/intelligent-ic-rgb-5050-led-strip/magic-dream-color-intelligent-1903-ic-rgb-5050-led-strip.html

lothas

I have some additional info on the control requirements:
The chip that I need to control works at 800kHz or 400kHz. Each cycle can be divided into 3 parts: if the first 2 parts have high voltage then the controller "reads" a '1', if only the first part has high voltage then the controller "reads" a '0'. If all parts have low voltage, the controller resets.
So I guess that I need the arduino to output a signal at 1.2MHz. Can it even do that?

robosuv

#2
Mar 26, 2012, 07:54 am Last Edit: Mar 26, 2012, 07:57 am by robosuv Reason: 1
I've been looking at playing with the 1903 rgb led chip. It'll be a long time before I get around to it, but it looks interesting and was looking to see if anyone has made a project with it. That's how I happened upon your question (3 weeks later).

I've not been able to find an English version of the PDF, but by running pieces through Google Translator I've got a better understanding of how (I think) it works. I've not worked with Arduino; I will be looking at using some 8051 chips I have around. The challenge will be the bit timing. At first glance I thought I could use a serial port to shift bits out. But the wave is more complex "NRZ".

The two waveforms you're mentioning (page 8 ): The first is Data In, what you'll send it. The second is its Data Out to the next chip. Note the tolerance allowed on the input and the precision it expects to provide on the output.

At 800khz, one bit is 1200 nano seconds. (800 khz is actually 1250ns, but I'm echoing what the spec says.) The cycle always start on the high side. If it is low longer than high, it's a zero; if it's high longer than low, it's a one. Nominally, a zero would be 300ns high and 900ns low. A one would be 800ns high and 400ns low.

Perhaps the simplest approach would be to use a 400ns interrupt. A zero is then 1 high plus 2 low (100 = 400/800); a one is two high plus one low (110 = 800/400). This falls within the specs. A similar approach could use a 3-bit shift register that's filled with 100 for a low and 110 for a high. One might be able to fill a 9-bit UART with 3 bit sets and have it shift out at 2.4mhz to get the effective 800khz bit rate.

The chip's data in always cascades to the output. The first 24 bits a chip receives are processed for itself. It then sends all remaining bits through its DOUT. When the first chip is sent Treset (a low for 24us) it cascades out to tell all the chips to start over again, grab the first 24 bits they see and send all others out.

Page 6 explains that the chip in constant current mode can be adjusted between 10ma and 41ma for each of the three output leads. It can be switched into PWM. It seems you first tell it what constant current you want to use by setting the T1 bit and then start sending PWM to control each output between 0 and 255 over 255. By default it uses 20ma for PWM.

It's all theory for me. I've only looked at the specs in the past few days. As I said, I'll probably not be working with the chip for a long time -- too many unfinished projects to justify another right now.

I hope this helps some and is not too late.

Rich in Ramona, CA.

dtokez

would be good to have a look at these, they are pretty damn cheap on ebay from china :)

lothas

I tried setting an interrupt with my arduino but couldn't get it to work properly. I'll probably sit down with an electrical engineer next week and try to figure it out (I'm a Mech. Eng. :) )

lothas

UPDATE: I tried setting an interrupt with the arduino and measured the output pin with an oscilloscope but it would seem that the arduino can only do up to ~25kHz interrupts, probably because of overhead. Not to mention that this was done without any code on the ISR. I guess I'll have to buy the digital LED strips on the adafruit website :(

Go Up