Jump to content

How to modify DOUT for dimming contorl of led matrix?


intellijel
 Share

Recommended Posts

I have been toiying with whether to use the dout module or make my own using a max7219 led driver. The reason for using the max7219 is the built in dimming control of the whole matrix (built in pwm).

How can I modify the DOUT module for this behaviour? Build a square wave generator and modulate on/off the connection between the cathodes and ground? Must be a simpler way?

cheers,

    Danjel

Link to comment
Share on other sites

Dim the whole matrix?

The LEDs are connected to shift registers, you can disconnect the /OE (Output Enable, active-low) pin from ground and connect an oscillator there.

Maybe the PWM source could come from software using an unused DOUT pin, but I'm not sure if software performance would suffer from this. I think it depends of which MIDIbox you're building. I can't tell you what can be done there though...

There are other possible PWM sources. Custom-tasked chips like the one you're talking about, a 555 timer circuit controlled by a potentiometer, or even an AOUT module, etc.

You'll need to tell more about what you're already planning to run from the core module and/or wait the reply from someone else to see if the PWM could be done in software. If it works, it's a matter of cutting a pin, soldering a wire and modifying the software. If it doesn't, it's going to be an oscillator.

Controlling the brightness from software could be done from a menu, an encoder or a potentiometer.

Link to comment
Share on other sites

Hi there,

I am building this functionality into a big controller with lot's of buttons and leds (button/led matrix). The leds are rgb with the anodes of each colour connected to a single SR. So if I need to balance the different colours, I would adjust the pwm of the SRs that drive that particular colour.

If I set up an oscillator to pulse the OE pin of the SR that should work. If I can find a suitable simple DCO that can receive control signals from spare dout pins (or pins on the core) then I can write a routine that will allow me to control dimming via software without having to send a constant stream of data.

Link to comment
Share on other sites

I wonder if one of those serial-controlled LED drivers could be connected to /OE...

I just found the PCA9635, that one really does just brightness control over I2C, and they claim an external driver can be connected to the outputs (It can invert the output as well, so there's no signal to invert between it and the SR.) There's a problem called TSSOP28-only with this chip though. (But a TSSOP package doesn't look too much like a PITA to solder compared to changing the complete DOUT module for an other controller.)

Link to comment
Share on other sites

there should be PWM ICs you can buy that can have there duty cycle set by either databits or a DC voltage. If I use the ones that are set by DC voltage then I can just use a spare DAC pin on the PIC. I have found chips that do this but they seem to be obsolete. There must be something I cna use but to be honest I haven't looked too hard yet ;)

Also, maybe I do not need digital control. I can have a few small pots on my controller that I use to adjust the brightness of each colour with. If this is the case, there are some simple 555 based circuits that should work.

cheers,

  danjel

Link to comment
Share on other sites

Note that the PIC has two PWM outputs as well.

However, controlling the brightness of individual LEDs is not possible with the MIOS concept, as it would load the CPU so much, that no other tasks could be executed in parallel. Problem is, that you need a PWM period of 10 kHz and more if brightness should be controlled with a resolution higher than 3bit.

Thats the reason, why normaly dedicated chips (or microcontrollers with special integrated PWM peripherals) are used - they keep the load of the main CPU low.

Best Regards, Thorsten.

Link to comment
Share on other sites

Yeah I only want to modify the brightness of a 3 seperate banks of LEDS (e.g. need 3 pwm sources).

Each bank may have 64 leds or more spread out over many 74hc595. Each SR will only be connected to one colour so that all like coloured SR can have the OE pin connected to the same PWM source.

cheers,

    Danjel

Link to comment
Share on other sites

The PIC has only two PWM, and I checked the PIC datasheet, and it looks like there's only A/D pins, no D/A.

It looks like a serially-controlled LED PWM driver or an analog solution would work the best.

I don't know how hard it would be to program the feature in software, but those little serially-controlled LED drivers cost only around $2.50.

Link to comment
Share on other sites

do you mean use the led drivers (e.g. maxim7219) in lieu of the 74HC595 shift registers or in addition (use them only for the pwm)?

If they are used instead of the DOUT SR, the difference is that they are 16 bit so the code that normally communicates with the 8bit SR would obviously have to be modified to deal with this. I assume this is not too difficult?

The max7219 can also be chained like the SR but I can't remember what the limit is. The result will be more compact Dout boards with increased functionality! Only one resistor per chip to set the led current limit. Maybe a darlignton array would still need to be employed if building an rgb matrix with common cathodes.

I remember TK opposing this before since he wanted to make sure that all the components in the Midibox were readily and universally available unlike specialized maxim chips. I still think it would be very useful to the community to develop (and layout) an alternative DOUT that uses enough maxim chips to drive a 64x64 matrix of rgb leds (that's only three IC's, one per each colour and with a dedicate dimming circuit for each ).

Anyone quick with layouts who can do this? Maybe put together a bulk order to purchase boards? I know I would buy at least 10

Link to comment
Share on other sites

Maybe Ralf's implementation will give you some additional inspirations:

http://www.suckow.de/ralf/ledmatrix4x20/

It has been used in Monodeck II:

http://www.monolake.de/monodeck/index.html

Yes, I prefer 74HC595 only because it will still be available in 10 years and more, and it can be purchased worldwide.

Maxim chips are coming and going... sometimes they are out of stock, and you will have to wait some months for the next production run. Or they will be discontinued, and you will have to search for a replacement part. No issue if only a small circle of people is interested for a short term...

Best Regards, Thorsten.

Link to comment
Share on other sites

I have been talking with Ralf and he was kind enough to send me the files and details of the monodeck construction (modified code, problems they encountered and mods to the standard midibox stuff).

The example of the 4x20RGB matrix was modfied to a 4x8 = 32 rgb matrix. Each colour was driven by a single SR so 4 SR's could control 3 colours and the column switching.

The trouble is that they needed to create a special circuit to do the dimming of each colour. From what I have read, many people are trying to implement similar things. Look how popular the monome has been! There is even a standard library for using the max7219 with the arduino/wiring board.

So either I find a simple way to dim the 74HC595's or else I will design something to use the max7219 (which i am sure can be easily adapted in the future for better chips).

Electronics is progressing to quickly to make designs expected to last 10 years! If it stays current for a year I will be happy :p

Link to comment
Share on other sites

do you mean use the led drivers (e.g. maxim7219) in lieu of the 74HC595 shift registers or in addition (use them only for the pwm)?

Using a serially-controlled LED PWM conencted to /OE pins of the shift registers.

There are a few reasons:

-The PIC doesn't seem to have D/A pins.

-A software-generated signal would overload the core.

-There are only two PWM pins on the PIC.

-Almost no modifications to do to the existing DOUT module.

-Cheap (Chip costs less than $3).

-The PWM is optimized for LEDs.

I looked a bit at NXP's PCA9635(second result I found on Google), it has an I2C input, and 16 independent outputs which seem quite flexible (Overall and independant PWM control, "blink" feature, etc.)

It can drive a LED directly or drive a controller (The SR in this case) and even invert the output signal (No need for an inverting transistor)

The good:

-There's only a 5V source, the I2C serial port + address pins and the PWM outputs to connect, there are no other pins on the chip.

-Does everything you need (Over 3 PWM sources, can drive the /OE pins directly), there are no other components to buy.

Problems:

-Only available at Digikey (probably not from a local store)

-Surface mount (But TSSOP looks quite easy to solder), needs a PCB.

-Software to write.

If you can deal with these problems, it could be quite simple to use. I'd personally prefer this chip vs. making three 555-based circuits, but that's my opinion, you could have another one.

Link to comment
Share on other sites

  • 2 months later...

Yes, I prefer 74HC595 only because it will still be available in 10 years and more, and it can be purchased worldwide.

I'm appreciating this point more and more.

Anybody have any recommendations over the PCA9635?  I'm pretty new to soldering and would prefer not to have to deal with SMD.

The maxim7219 seems to support dimming of ALL connected LEDs.  I'm looking for an IC that will do them individually.  I found an ST2226a which seems to be exactly what I want, but, like TK says, I can't actually buy the thing anywhere :/

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...