LED Matrix help
Moderator: Guido Körber
LED Matrix help
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
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
-
- Site Admin
- Posts: 2856
- Joined: Tue Nov 25, 2003 10:25 pm
- Location: Germany/Berlin
- Contact:
-
- Site Admin
- Posts: 2856
- Joined: Tue Nov 25, 2003 10:25 pm
- Location: Germany/Berlin
- Contact:
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........
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
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)
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
-
- Site Admin
- Posts: 2856
- Joined: Tue Nov 25, 2003 10:25 pm
- Location: Germany/Berlin
- Contact:
-
- Site Admin
- Posts: 2856
- Joined: Tue Nov 25, 2003 10:25 pm
- Location: Germany/Berlin
- Contact:
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.
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.
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 ;
As expected, I get all segments lit.
When I send this code ;
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;
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
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)
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)
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)
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
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
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
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
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
-
- Site Admin
- Posts: 2856
- Joined: Tue Nov 25, 2003 10:25 pm
- Location: Germany/Berlin
- Contact:
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.
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.
-
- Site Admin
- Posts: 2856
- Joined: Tue Nov 25, 2003 10:25 pm
- Location: Germany/Berlin
- Contact:
Please send PDF to support@codemercs.com