5x7 Led Matrix data struct?

Hi all,

I found a LED Matrix sign (not sure how they are called) in a dumpster the other day and trying to revive it as an opportunity to learn. It consists of 19 5x7 LED Matrix units, controlled by shift registers for the columns and transistors for the rows.

I'm trying to come up with a data structure to represent the LED's for each character. As far as I understand the smallest possible data structure I could use is a byte (or char) which is 8 bit long.

I'm trying to reduce code footprint to the minimum and using 8 bits for columns will waste 3 bits. Plus, it will make harder to form the bit-stream that will be shifted out.

Any suggestions, on any better way to handle the data?

(PS. I have no code nor a schematic yet...)

Thanks in advance, Nikos

Got a pic of the backside where you see the chips?

5 bytes per char may be the best you can do

It may be that when you shift a byte of data into the display, this lights a vertical column of 7 leds not a horizontal row of 5. If so, you would be better off organising your data structure to match, in which case you can represent a character as 5 bytes and only 5 bits will be wasted.

Well, 1 byte for kerning will probably be necessary so let's call it 6 bytes

Thank you for your replies,

The sign is a Cybernetic Data Products and as said consists of 19 5x7 Lite ON LED matrices |500x375

The original logic board consists of 6502 with the appropriate amount if supporting circuitry, ie RAM, ROM, etc. On that board 7 TIP120 transistors are responsible of powering the 7 ROWS |500x375

Here is a close up of some of the LED's and some of the driving circuitry. DS75492 LED driver and MC14015 shift registers |500x375

I'm still trying to draw the whole circuit diagram, but in the mean time I need to start thinking of the code.

I was thinking, instead of representing a char as 7 bytes (one byte for each row) and therefore loose 3 bits from each byte (ie 3x7=21 bits) to just create a 5 byte array and stuff in there all the bits from all rows.

That way I will need 5x7 = 35 bits / 8 = 4.3 that is 5 bytes. This will help me loosing only 40-35 = 5 bits in total for each character.

Plus it will be easier adding the bits into the bit-stream by shifting and ANDing with the help of a patern of 0x1F

Just brainstorming here...

nikosk: I was thinking, instead of representing a char as 7 bytes (one byte for each row) and therefore loose 3 bits from each byte (ie 3x7=21 bits) to just create a 5 byte array and stuff in there all the bits from all rows.

That way I will need 5x7 = 35 bits / 8 = 4.3 that is 5 bytes. This will help me loosing only 40-35 = 5 bits in total for each character.

Plus it will be easier adding the bits into the bit-stream by shifting and ANDing with the help of a patern of 0x1F

Just brainstorming here...

Neat brainstorm. 0 points for originality seeing as how that's literally what all the advice you've gotten was. Have you even read the replies?

If you plan on having scrolling text, you will need 6 bytes. One blank column so the letters get spaced out. Relying on the physical separation of each matrix between letters may not look good because they're so close together. But that's a whole other problem. See how it looks before tackling that.

I did read your replies.

Regarding Paul's, the board is designed so that each bits shifted towards the registers control columns and not rows. So it does not apply here. However, maths are the same as 5x7 = 7x5. To be honest, I did not check his second sentence, as the first one was not applicable (ok, my bad).

Regarding spacing, why would I want to represent the spacing to my characters and not add it later on when forming the bit-stream to be shifted out? Is there any benefit?

Scrolling is to far away :( Need to start with easy stuff first... Just show something....

INTP: Got a pic of the backside where you see the chips?

5 bytes per char may be the best you can do

oops I completely missed that comment...

nikosk: the board is designed so that each bits shifted towards the registers control columns and not rows... Need to start with easy stuff first... Just show something...

But how do you know that if you have not managed to show anything yet? Tracing the PCB tracks? Have you found the data sheet for the 5X7 modules yet?

nikosk: maths are the same as 5x7 = 7x5.

But using 5 bits of a byte wastes 3 bits, whereas using 7 bits of a byte only wastes 1 bit... However, even on an ATmega328, neither level of waste is a concern. It has 32KB flash.

Hi,

PaulRB: But how do you know that if you have not managed to show anything yet? Tracing the PCB tracks? Have you found the data sheet for the 5X7 modules yet?

Sorry I should have mentioned it. I did a bit of a research and found this guy here that has almost the same Led sign. I compared his drawings with the PCB I have in hand and they seem to be of the same design. Same Drivers, same shift Registers.

Checked that all column pins of the LTP-2157 led matrix (cathodes) are connected to the driver IC's which in turn are connected to the shift registers. Also, all row pins of the led matrix (Anodes) are connected to the TIP transistors.

That far, I have gone... I did start drawing the schematic but its still in bits and pieces.

PaulRB: But using 5 bits of a byte wastes 3 bits, whereas using 7 bits of a byte only wastes 1 bit... However, even on an ATmega328, neither level of waste is a concern. It has 32KB flash.

Well, I might be overreacting, here... Although its not the flash I'm worried about, its the static RAM. OK, the char definitions will be in PROGMEM, but still even without them, 2K is scary...

I do not know if something like that would work, but instead of creating a character as an array of bytes like:

unsigned char characters[][7] = { { 0x4,0xA,0x11,0x1F,0x11,0x11,0x11 }, ...}  //A

to create is so:

unsigned char LetterA[5] = { 0x01, 0x15, 0x1F, 0xC6, 0x31 } //A

in the above the wasted bits are filled with bits from the previous byte row.

Will it work like that? INTP mentioned about 5 bytes but I'm not sure if he meant it this way or he meant shifting out rows instead of columns... any ideas?

So...12 8-bit shift registers drive the 95 columns?

Even if you memory-map the entire display, that's 84 bytes. You have 2048.

You may only need to buffer one row at a time, in which case it will take 12 bytes.

As you said yourself, the character bitmaps will be stored in flash. You code will just extract as much as it needs into ram. You will not need to have a copy of the bitmap for every possible character in ram.

I've also got a couple of those SilentRadio Cybernetic Data Products LED signs. Mine are the newer ones that used an external power supply that plugs into a DIN connector on the back of the sign. My signs did not come with the power supplies, so had to figure out what was needed. After applying power, neither of my signs have any life. I also have the proper keyboard for this sign, but does not help. I'm guessing that something is bad on the main logic board.

Thought I would try to run the 5x7 LED modules (LTP2157) using arduino. Can this be done using the existing TIP transistors and shift registers on the board?

Did you get your Cybernetic Data sign to work for you? If so -I'd be interested in knowing what hardware you are using. Thanks.