HT1632C led driver with software PWM - is it possible?

Hello,

I have 16x16 led matrix which is controlled by HT1632C driver, connected to arduino.
Everything works well, except that I can't controll the brightness of each led, the driver supports PWM only for each line.

So I thought if it would be possible to controll led brightness with software PWM,
For example, update matrix 80 times per second, where each 2nd time will be blank, that way, in theory, I should get leds with half brightness,
Datasheet says, that ht1632c works on 256khz, which should be enough, I suppose, but unfortunatelly, when I try such method, it updates either to slow, or, looks like crazy christmas tree lights, which is not exactly what I am looking for.

Does anyone have any experience with controlling led driver with software pwm? Is it really possible?

Thanks in advance for your help and advices.

i.

Hi,

The data sheet says the clock frequency is 256KHz, but the multiplex frequency for individual leds is 256000 / 2624 = 97 Hz. You might be able to achieve 3 brightness levels (or off), but you might well find that because you can't synchronise your updates to the display refresh exactly, you would just get random interval flashing, as you have already seen.

So I don't think it would work, sorry.

Paul

Thanks a lot for you reply, Paul!
I suspected, that it happens because of the sync, but thought this could be somehow bypassed.

Do you think, that synchronisation couldn't be achieved even when using another time? I mean TimerOne & TimerThree Arduino Libraries Timer1 library for example..

Are there any other drivers or possibilities to control 256 leds with one arudino, using as less pins, as possible, so that brightness of each led could be controlled?

Thanks in advance again!

deimoscz:
Do you think, that synchronisation couldn't be achieved even when using another time? I mean TimerOne & TimerThree Arduino Libraries Timer1 library for example..

No, the problem is syncing the Arduino and the driver chip to each other. Using different timer libraries won't help with that.

deimoscz:
Are there any other drivers or possibilities to control 256 leds with one arudino, using as less pins, as possible, so that brightness of each led could be controlled?

Yes - WS2812B leds, sometimes called "NeoPixels". Only one Arduino pin needed. Cost around £50 for >256 leds on a strip on eBay. Cut 16 strips of 16 leds and stick down to a board, then wire them together and to the Arduino. Also get a 5V power supply with around 20A capacity. Depending on the required size of the 16x16 matrix, you can choose strips with 30, 60, 72 or 144 leds per metre.

Or buy this panel: http://www.seeedstudio.com/depot/16x16-RGB-LED-Matrix-w-WS2812B-DC-5V-p-2011.html

Or this one: http://www.ebay.co.uk/itm/256-Pixel-LED-RGB-16-16-Matrix-WS2812B-Individually-Addressable-Pixels-Panel-/261560479646?pt=UK_Home_Garden_Lamps&var=&hash=item3ce6382f9e

Thanks a lot!

It looks like those neopixels are great.
The only thing is that I need something with less capacity, 20A is to much for my accumulators (i need 6x256 panels), and white only leds.

I already have 256 smd white leds, would it be possible to drive them somehow with external driver and with pwm support for each led? I found a video, where tlc5940 are used (- YouTube), but didn't find any additional info of how it is possible.

Are there any other variants that use less power and cheaper? Thanks again for you help!

Tlc5940 is an option, but unless you want to use 16 of them, you would need to multiplex it.

There is a technique I know of but have never tried.

You would multiplex the matrix using the Arduino and shift registers (either 74hc595s driving transistors or tpic6a/b/c595, maybe both).

To achieve individual dimming of each led, you would multiplex as follows.

The first pass through all 16 rows would light each led for, say, 500us. That's 8ms in total.

On the next pass, each row is lit for 250ms, total 4ms.

Third pass, 125us each row, 2ms total. Fourth pass, 62us, 1ms total.

Then the sequence starts over. The whole sequence takes 8+4+2+1=15ms, so fast enough to avoid visible flicker.

Any particular pixel can be lit or not lit in any combination of the 4 passes, a total of 16 combinations from off to max brighness and 14 other brightness levels between.

Writing the sketch to achieve is not trivial, nor is wiring the shift registers and matrices.