LED Matrix help

This is the English forum for all topics related to IO-Warrior. Please post in English only

Moderator: Guido Körber

Jon
Posts: 42
Joined: Thu Jul 06, 2006 12:43 pm
Location: downUNDER

LED Matrix help

Post by Jon »

Hello..........

Can anyone help me to understand the data format that is sent to the IOW40 in LED matrix mode?
Ive searched the forums, read all the documents, but I am having trouble getting my head around this (probably very simple) concept.
In particular the 32 bits for the column drivers.

I am using Delphi as the programming language, and the application is going to be a digital display of 6 x 4digits using 7 segment displays
ie
2280
1810
1350
0990
0353
1200

plus a few single LED's.

As the data from the software changes, these displays will update, probably by rewiting the complete matrix, rather than trying to turn on/off indivdual segments.

Regards and thanks in advance,
Jon
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Post by Guido Körber »

You are writing the status of the display into the IO-Warrior. What a 7 segment display connected to the matrix function will show depends on how you did set up the wiring.[/i]
Jon
Posts: 42
Joined: Thu Jul 06, 2006 12:43 pm
Location: downUNDER

Post by Jon »

Thanks for you promt reply....

Yes, that is correct with regard to the wiring, but that is not my question/query.
The problem is, I cant grasp the concept of the data format for the $15 report....... row/data0/data1/data2/data3
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Post by Guido Körber »

The matrix has 8 rows with 32 colums each. You are writing the data by row.

The first byte in the report specifies which row the following data should go to, then you send 4 bytes containing the bits for the matrix.
Jon
Posts: 42
Joined: Thu Jul 06, 2006 12:43 pm
Location: downUNDER

Post by Jon »

Ahah!
It is becoming clearer!

So, in a led matrix of (R1-R8 x C1-C32),

to turn on (R3,C4)
I would send......
00000100 00000000 00000000 00000000 00001000

which would be something like........

Code: Select all

' Write to LED Matrix 
Dim data(7) As Byte 
    data(0) = 15 
    'rows 0 to 7 
    data(1) = 4 
    'bytes 
    data(2) = 0
    data(3) = 0 
    data(4) = 0 
    data(5) = 8 
    Res = IowKitWrite(iowHandle, IOW_PIPE_SPECIAL_MODE, data(0), 8) 
and to turn on (R3,C4 and C11)
I would send......
00000100 00000000 00000000 00000100 00001000

And I assume I send one of these for each row, so 8 blocks of data are sent to update the complete matrix

Jon
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Post by Guido Körber »

Almost right, except for the ordering of the columns, the first byte of the column data holds columns 0..7.
Jon
Posts: 42
Joined: Thu Jul 06, 2006 12:43 pm
Location: downUNDER

Post by Jon »

Thankyou very much for your explanation.
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Post by Guido Körber »

I am moving the topic about the driver circuit over here from the German forum.

There actually is not much of a circuit when using the ULN2803 as column driver for the LED matrix. You can use 74xx595 as the shift/latch registers and connect them straight to the ULN2803 inputs. The cathodes of a column of LEDs are then connected via a resistor to one outputs of the ULN2803.

The circuit for the row drivers depends on how many LEDs you want to drive. Due to the multiplexing a column driver only has to drive a single LED at any time but a row driver needs to be able to supply sufficient current for all LEDs in a row.

Row drivers may be built with a 74xx595 and 8 suitable transistors, i.e. BD137.

If you see unstable behaviour, like flickering depending on the number or pattern of LEDs enabled, likely you have a problem with the power supply to the circuit. When using 74HC(T)595 quite some care has to be taken when laying out the power supply to the chips.

CMOS chips do not draw much power while in a static state but their current consumption can have savage bursts when switching. Unless you put 100nF ceramic bypass capacitors right at the power supply pins of the chips you can see all kinds of erratic behaviour.

Also cable length between IO-Warrior and LED circuit is an issue. The signal frequency there is several 100kHz, running this through a too long cable can result in instable behaviour as well.
Jon
Posts: 42
Joined: Thu Jul 06, 2006 12:43 pm
Location: downUNDER

Post by Jon »

OK, we will have another try with this.

I am getting no flickering, so maybe I said it wrong when I said I was getting erratic behaviour.


I have built the circuit shown in the AN1 using transistors for the 8 row drivers. I hope we are not getting confused here, as I would call these columns because in the circuit they run vertically.

I have (at this stage) only one of these row lines connected to the common anode of four seven segment displays.

I have connected the segment display cathodes to the outputs of the MIC5821 so that segments a to h are pins 16 to 9

When I use this piece of code ;

Code: Select all

' Write to LED Matrix
Dim matrixdata(7) As Byte

    matrixdata(0) = &H15
    'rows 0 to 7
    matrixdata(1) = 3
    'bytes
    matrixdata(2) = 255
    matrixdata(3) = 255
    matrixdata(4) = 255
    matrixdata(5) = 255
     Res=IowKitWrite(iowHandle,IOW_PIPE_SPECIAL_MODE,matrixdata(0), 8)
As expected, I get all segments lit.

When I send this code ;

Code: Select all

' Write to LED Matrix
Dim matrixdata(7) As Byte

    matrixdata(0) = &H15
    'rows 0 to 7
    matrixdata(1) = 3
    'bytes
    matrixdata(2) = 0
    matrixdata(3) = 0
    matrixdata(4) = 0
    matrixdata(5) = 0
Res=IowKitWrite(iowHandle,IOW_PIPE_SPECIAL_MODE,matrixdata(0), 8)
Again as expected, I get no segments lit.

Now the interesting part. Say I want to light up the first seven segment display so that it shows the number 3. I would need to send the binary number 11110010 so that segments A,B,C,D and G light up.
Binary 11110010 is equal to decimal 242, so I send the follwing code;

Code: Select all

' Write to LED Matrix
Dim matrixdata(7) As Byte

    matrixdata(0) = &H15
    'rows 0 to 7
    matrixdata(1) = 3
    'bytes
    matrixdata(2) = 242
    matrixdata(3) = 0
    matrixdata(4) = 0
    matrixdata(5) = 0
Res=IowKitWrite(iowHandle,IOW_PIPE_SPECIAL_MODE,matrixdata(0), 8)
But what I actually get is segments C,G and H !

If I send 96 to turn on segments A and B, I get segment H only
If I send 254 to turn on all segments except H (the decimal point) I get Segments A,B, C, F, G ,H

So, this is what I mean by strange behavior.

Any ideas as to why this is happening?

Jon
wayoda
Posts: 362
Joined: Fri Dec 19, 2003 12:00 pm
Location: Wuppertal/Germany

Post by wayoda »

Hello Jon
are you sure you got the mapping between the segments on the display and the connections to the driver right?

What happens if you send the bytes for
00000001
00000010
00000100
....
10000000
Only one segment should light up for each value. This should be the mapping between the bits you send and the segments that get switched on.

Could you try this and tell us if it worked as expected?

Eberhard
Jon
Posts: 42
Joined: Thu Jul 06, 2006 12:43 pm
Location: downUNDER

Post by Jon »

Ok,

I send 00000001 00000010 00000100 ........ 10000000 (converting to decimal 1,2,4,8,16,32,34,128)

And I get...... nothing ! No Leds light up!

I have checked that the coresponding pins on the MIC5821 are connected to the right segments by grounding each pin and watching the displays.
Jon
Posts: 42
Joined: Thu Jul 06, 2006 12:43 pm
Location: downUNDER

Post by Jon »

The other interesting thing is that whatever data I send to the matrix, for example 255,255,255,255 Led 1 will not illuminate. That is the one that should turn on with 00000001 as the first byte. All others are on.

Investigating this further.......

If I send 0,255,0,0 , you would expect that all LED's on the second segment would illuminate. But, segment A, the first bit in the byte does not light up. This is the same if I send 255,0,0,0 or 0,0,255,0 or 0,0,0,255, segment A of the display will not illuminate.

Jon
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Post by Guido Körber »

Sounds like a wiring problem. The matrix function does definitely handle all coordinates properly.
Jon
Posts: 42
Joined: Thu Jul 06, 2006 12:43 pm
Location: downUNDER

Post by Jon »

Guido, I agree, which is why my original question was if a circuit board diagram was available.
Would you be interested in looking at the one I built along with the full schematic I drew to check the board with? It was designed using ExpressSCH and ExpressPCB, but can be exported as a BMP (schematic) or PDF for the board.
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Post by Guido Körber »

Please send PDF to support@codemercs.com
Post Reply