RGB Led Matrix backpack reprogrammed

I am trying find out how to write the code for the ATMega8 that is on the backpack so that it will show more than 8 colors. I have a couple of Arduino’s and the backpack/matrix, I am waiting for an AVR usb programmer, should be in soon. All this to ask for help in rewriting the code, I have not writen software, except for some shell script, in over 15 years, and then it was assembly, so I could use some help here… I can work with C, but not sure where to start and what I am trying to accomplish, not sure how the board works to begin with, the online description is kind of vague. All I want is to be able to send more than 8 colors to each RGB on the board from an Arduino.

Thanks

What you need to do is add additional color codes to the data stored on the Mega8. Instead of the current 0 - 7, you might store 2 bits per color, for a total of 128 colors. In 8 bits, the max would be 256, but would require a 3:3:2 mapping. Once you have this, you vary the intensity of the LEDs by pulsing depending on the value, i.e. PWM.

I did not understand tha last part, 3:3:2 mapping(?). I do understand the PWM part, and I have looked at this with another board, just did not want to reinvent the wheel here. I was thinking about doing the 8bit thing. I am going to have to get with my fellow professor that teaches programming and see if he can help me with the C code, I am good with RealBasic (kinda like Visual Basic but better) but I have not had too much experience with C, I am going to have to figure out the whole PWM thing from the ATMega8 side, I have done this with circuitry but not from software.

Thanks for the help so far

scottie4442:
I did not understand tha last part, 3:3:2 mapping(?). I do understand the PWM part, and I have looked at this with another board, just did not want to reinvent the wheel here. I was thinking about doing the 8bit thing. I am going to have to get with my fellow professor that teaches programming and see if he can help me with the C code, I am good with RealBasic (kinda like Visual Basic but better) but I have not had too much experience with C, I am going to have to figure out the whole PWM thing from the ATMega8 side, I have done this with circuitry but not from software.

Thanks for the help so far

Since there are 8 bits, you have to divide them for RGB. Say 3 bits for R and B and 2 for G. So you get 0, 12.5, 25%, 37.5, 50%, 62.5, 75, 87.5 and 100% (almost) for red and blue. Green only gets 0, 25%, 50% and 100% (almost). It is almost because there is some overhead (1 interrupt cycle), so you don’t get 100%.

Another possibility is to use a color LUT. Depending on how much memory you want to dedicate and perhaps performance (I have not done any calculations), you can have many more color possibilities. This is how old PC cards worked.

As for the PWM, it is merely counting and comparing. At the start of each frame cycle (say 60Hz), you load the brightness value and turn on the corresponding LED (unless it is 0). Each loop, you decrement the value and if it is 0 turn off the LED. Since you have 8 rows per frame and 8 brightness levels, you will need to interrupt at least every 1/(60 * 8 * 8 ) S. I am not sure of my math, I have been thinking about how I would do it, but have not spent the $ yet.

I was a little concerned regarding the actual design of the controller.

  • 1. All channels have the same R value. I wonder if you get consistent brightness across RGB. I am curious what the actual current is.

    1. They are using 74LS595 for high side drive. These seem to be driving the LEDs brightly, but I don’t think they can source a lot of current. If it works don’t fix it?

    2. A user has had problems with ghosting. This may need to be addressed.

    3. I think that it is excessive to transmit all 64 bytes everytime unless it is live video. Since their SPI clock is limited to 125 KHz, this may limit the number of displays. Lets see, 125 KHz gives roughly 15625 Bps or 244 displays/S.

    4. The use of SPI makes it a little hard to daisy chain these things. Although the current design makes them independent, it puts some row, column translation burden on the host.

    I have to admit that these is all random musings of and interested mind (what’s left of it). I am sure that others will correct me soon :lol: .

  • This clears up a lot, thanks… As for using more than one LED Matrix, in this application this will not be an issue, I am goin to connect the backpack controller to a larger LED Matrix setup using transistors to drive each LED set and a separate power supply for the LED board. I am only trying to drive a 4x16 matrix for a jukebox conversion I am doing.

    scottie4442:
    This clears up a lot, thanks… As for using more than one LED Matrix, in this application this will not be an issue, I am goin to connect the backpack controller to a larger LED Matrix setup using transistors to drive each LED set and a separate power supply for the LED board. I am only trying to drive a 4x16 matrix for a jukebox conversion I am doing.

    Are these individual 4x16 LEDs? If so, there are chips that can control 64 LEDs quite well, for example, the max7219 or max7221 check out this discussion viewtopic.php?t=7415 . There are several discussions on LED matrixes. I forgot to mention that you might be able to get max7219 samples.

    thanks I will have to look into these. I was planning on doing a group of leds for each “block” in the matrix, instead of a single rgb led i was going to make a group of 3 green, 3 blue, and 4 red and treat them like one block in the matrix, I will run them with transistors (I have already figured this part out), but I needed a way to control them and the only controllers I could find cost over $300.

    Are you grouping them for brightness, size or some other reason. Unless the viewing distance is significant, color blending may be comprised.

    I am grouping them for brightness, the cells in the matrix are going to be about 3 or 4 inches on a side and I will use some diffuser material on the front, but they will only be about 4 inches deep so not much spread here.

    The reason I asked is that you might be better off with individual but brighter LEDs. The Max chips are capable of putting out significant current.

    Anyway, I am sure that a picture of the results would be appreciated.

    I guess the answer is yes but:

    with this backpack, may I drive a 8x8 led matrix made with 64 rgb leds like that http://www.sparkfun.com/commerce/produc … cts_id=105 ?

    http://www.sparkfun.com/commerce/images … L_i_ma.jpg

    the question is about current driving

    http://rgb.kitiyo.com/ the rgb led project, controld via the USB using PIC 18F4550, but uses 6 legged LEDs !!!

    since my last post, i tested, it works fine.

    http://www.julienbayle.net/diy/LiveInterface/

    So has anyone managed to reprogram the Sparkfun backpack to produce more than 8 colours?

    I’d be interested to do this, at the moment I run 4 of the units with an arduino providing data over SPI.

    Cheers Nick

    595 cannot dimme

    it can only make 0 or 1, I mean: off or on.

    mrnick1234567, do you know the maxi current the backpack can drive ?

    I see there are resistors before the output … so…

    No I don t know the max current. When you say 595, what are you referring to, is this a component on the backpack?

    indeed.

    you should watch the schematic on the shop page:

    http://www.sparkfun.com/datasheets/Comp … ematic.pdf

    Ah I see. Even if there is no dimming function, is there any way you could vary the intensity by flashing the leds on an off very quickly, thus varying the colour do you think?

    Is this the same as PWM referred to at the top of this thread? (Sorry if these are basic questions)

    I guess all is possible

    the question is: is it stable? fast? etc

    I think it would involve interrupt service routine by the Atmega8 on the backpack… I don’t know if it could be useable for real …