Bi-Color matrix

Post here to let others know of a project you're working on.

Moderators: Chuckt, Garth, bitfogav

Post Reply
User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by brad » Mon Oct 15, 2012 7:43 pm

Hmm, I apologise - looking at the data sheet it does come up with 4v forward voltage drop per pixel. which seems strange - I wonder why they don't specify for each color - Red / Green.

Nonetheless you still have plenty to drop on a series resistor. Just make it a low value and you will get plenty of brightness out of them :)

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by MrDEB » Tue Oct 16, 2012 12:34 am

I tried at 5v no resistor and only 3-4ma draw. The LED won't even light up. Now using an 8.4v battery pak, 120ohm resistor I get 30ma. Lit up a green and a red on one anode and get full brightness (two separate 120 resistors) and an NPN transistor. Almost 60ma
I require the higher voltage. Just how much needs to be determined but on paper its at least 6v I hope. Need to calculate. I know on paper 5v should work BUT one loses voltage via the transistor and/or the ULN2803 so now your outta juice.
Project on hold until I get parts delivered.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by brad » Tue Oct 16, 2012 5:22 am

Do you mean that you tried 5v straight from your power supply? I.E. without going through the microcontroller or any other circuitry?

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by MrDEB » Tue Oct 16, 2012 6:49 am

No I used a 120ohm resistor connected to the display, only one LED and I get 4.1 ma
Not much voltage left.
When I used the NPN transistor no resistor I measure 2.9ma. LED is pretty dim.
I just redid these measurements to reconfirm
I found a schematic pretty much exactly what I am doing. Just waiting for parts.
http://tobiscorner.floery.net/led/big-7 ... lay-clock/

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by brad » Tue Oct 16, 2012 9:00 pm

I am happy to send you one of my 8x8 matrix displays. I'll send one along with the circuit boards for you - You should have some better luck with those plus it will be easier for me to help because it's exactly the same part as what i use :)

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by MrDEB » Tue Oct 16, 2012 9:09 pm

Thanks again.

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by MrDEB » Wed Oct 17, 2012 8:31 am

Well I connected the LED High Side driver and the LEDs are brighter BUT need to change some resistors and as Mike pointed out duty cycle(presently set at 10MS)
The high side driver TD62783APG controls the ROWS
at present I have the ULN2803 on the cathodes w/ a 220 resistor.
one row enabled: 1 colum = 12.4ma
2 colums = 22.9ma
3 colums = 32.8ma
4 colums = 42.3ma
5 colums = 51.2 ma
1 ROW, 2 COLUMS alternating back and forth w/ DELAYMS(10) = 12.3ma
Now I get what Mike was referring to about duty cycle

Conclusion dim LEDs screw up the POV idea. Been there done that
contemplating finish up the code THEN experiment with the TLC5917 Constant Current Sink. This might eliminate all the resistors down to one. Goes in place of the ULN2803.
Looking over the matrix cube description of how the current sink is set up I might just take a whack at it.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by brad » Wed Oct 17, 2012 9:04 pm

Are you trying to vary the brightness with pwm?

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by MrDEB » Wed Oct 17, 2012 9:18 pm

NO no PWM unless you want to count the delay between the two
led1=1
led2=0
delayms(10)
led1=0
led2=1
delayms(10)
continuous loop
the display looks great. Just need to increase the current by using smaller resistors but feel the TLC5916 might solve this issue?
Am going to wire up one and develop some code hopefully.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by brad » Wed Oct 17, 2012 9:23 pm

10mS seems very long. Is that how long you are waiting between cycling through each successive LED?

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by MrDEB » Fri Oct 19, 2012 1:14 am

Thats where I started from. That's the min of time to make two leds appear on continuously.
Problem is if I have more than one LED per colum ( 7 anodes scanning and one colum (cathodes) the LEDs are dim. WHY because the LEDs are in parallel with each other(common cathodes)
Trying different suggestions but keep coming back to needing more current but then the smoke escapes.
My present code works very well except when I have multiple LEDs on using one Cathode. Ignore the sub test but under the STOP sub the last 6 lines under cross, the one with all 5 LEDs on per colum 2 they are all dim.
Working on this one issue. I feel that maybe using a constant current sink(TLC5916) without any resistors will do the deed but need to experiment.After reading the data sheet IMO this application is what the chip was designed for. I might be wrong?

Code: Select all

{
*****************************************************************************
*  Name    : UNTITLED.BAS                                                   *
*  Author  : [select VIEW...EDITOR OPTIONS]                                 *
*  Notice  : Copyright (c) 2012 [select VIEW...EDITOR OPTIONS]              *
*          : All Rights Reserved                                            *
*  Date    : 10/16/2012                                                     *
*  Version : 1.0                                                            *
*  Notes   :                                                                *
*          :                                                                *
*****************************************************************************
}
{
*****************************************************************************
*  Name    : UNTITLED.BAS                                                   *
*  Author  : [select VIEW...EDITOR OPTIONS]                                 *
*  Notice  : Copyright (c) 2012 [select VIEW...EDITOR OPTIONS]              *
*          : All Rights Reserved                                            *
*  Date    : 9/19/2012                                                      *
*  Version : 1.0                                                            *
*  Notes   :brads suggestion 9/19/2012                                                                *
*          : new code revised board 10/15/2012                                                              *
*****************************************************************************
}
Device = 18F4520
Clock = 8
Config MCLRE = Off


'*********************************************************************
'Includes
Include "InternalOscillator.bas"

Include "utils.bas"
Include "convert.bas"


'*********************************************************************
'Dimension Statements (variable and constants

//Dim row As PORTD    // row 0 to 6


Dim row_buffer(7) As Byte
Dim count As Word
Dim x As Byte
Dim y As Word
dim z as word
//
Const Red_Data(7) As Byte =   (%0010001, %00001010, %00000100 ,%00010001, %00001010,%00000100, %00010001)// 5 colums left to right
Const Cross_Data(7) As Byte = (%00011111, %00000011, %00000111 ,%00011111, %00111111, %01111111, %01111111)
Const R_ows(8) As Byte =      (%00000001, %00000010, %000000100 ,%00001000, %00010000, %00100000, %01000000,%00111110)// 7 rows top to bottom
Const Green_Data(8) As Byte =      (%00000000,%00010001, %00001010, %000000100 ,%00001010, %00010001, %00000000, %00011111)// 7 rows top to bottom
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// STOP ROUTINE
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
sub test()
y=10
z =12  
y=3
z = 5   
For x = 0 To 14
                     PORTa = Green_Data(7)  // all on
     PORTD = R_ows(3)                       //row 4
     DelayMS(y)
                    
   
                     PORTa = Green_Data(3)  // middle segment
     PORTD = R_ows(7)
     DelayMS(z)
   
                      
   
    
   
     // DelayMS(y)
     //  PORTD.bits(x)=0 

      
next
x=0
end sub

sub STOP()

y=7
z = 5   
For x = 0 To 5
                     PORTa = Green_Data(1)
     PORTD = R_ows(1)
     DelayMS(y)
                     PORTa = Green_Data(2)
     PORTD = R_ows(2)
     DelayMS(y)
                     PORTa = Green_Data(3)
     PORTD = R_ows(3)
     DelayMS(y)
                     PORTa = Green_Data(2)
     PORTD = R_ows(4)
     DelayMS(y)
                     PORTa = Green_Data(1)
     PORTD = R_ows(5)
     delayms(y)
     next
   for x = 0 to 5  
   
     //CROSS
      PORTa = Green_Data(7)  // all on
     PORTD = R_ows(3)                       //row 4
     DelayMS(y)
     PORTa = Green_Data(3)  // middle segment
     PORTD = R_ows(7)
     DelayMS(y)
      
   
next
      
 end sub

Sub RIGHT()
y=5
z = 30    
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// first arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14
                  PORTC = Red_Data(0)
     PORTD = R_ows(0)
     DelayMS(y)
                  PORTC = Red_Data(1)
     PORTD = R_ows(1)
     DelayMS(y)
                  PORTC = Red_Data(2)
     PORTD = R_ows(2)
     DelayMS(y)
next
     delayms(z)
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     // second arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14
                  PORTC = Red_Data(0)
     PORTD = R_ows(1)
     DelayMS(y)
                  PORTC = Red_Data(1)
     PORTD = R_ows(2)
     DelayMS(y)
                  PORTC = Red_Data(2)
     PORTD = R_ows(3)
     DelayMS(y)
next
      delayms(z)
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// third arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14
                  PORTC = Red_Data(0)
    PORTD = R_ows(2)
     DelayMS(y)
                  PORTC = Red_Data(1)
    PORTD = R_ows(3)
    DelayMS(y)
                  PORTC = Red_Data(2)
    PORTD = R_ows(4)
     DelayMS(y)
next
      delayms(z)
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//fourth arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14     
                  PORTC = Red_Data(0)
    PORTD = R_ows(3)
     DelayMS(y)
                  PORTC = Red_Data(1)
    PORTD = R_ows(4)
     DelayMS(y)     
                 PORTC = Red_Data(2)
    PORTD = R_ows(5)
     DelayMS(y)
next
      delayms(z)
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// fifth arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14     
                 PORTC = Red_Data(0)
    PORTD = R_ows(4)
    DelayMS(y)
                  PORTC = Red_Data(1)
    PORTD = R_ows(5)
    DelayMS(y)     
                 PORTC = Red_Data(2)
    PORTD = R_ows(6)
    DelayMS(y)
Next
   delayms(z)                 
           
End Sub

//SUB ENDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sub LEFT()
y=5
z = 30      
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// first arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14
                  PORTC = Red_Data(0)
     PORTD = R_ows(6)
     DelayMS(y)
                  PORTC = Red_Data(1)
     PORTD = R_ows(5)
     DelayMS(y)
                  PORTC = Red_Data(2)
     PORTD = R_ows(4)
     DelayMS(y)
next
     delayms(z)
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     // second arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14
                  PORTC = Red_Data(0)
     PORTD = R_ows(5)
     DelayMS(y)
                  PORTC = Red_Data(1)
     PORTD = R_ows(4)
     DelayMS(y)
                  PORTC = Red_Data(2)
     PORTD = R_ows(3)
     DelayMS(y)
next
      delayms(z)
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// third arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14
                  PORTC = Red_Data(0)
    PORTD = R_ows(4)
     DelayMS(y)
                  PORTC = Red_Data(1)
    PORTD = R_ows(3)
    DelayMS(y)
                  PORTC = Red_Data(2)
    PORTD = R_ows(2)
     DelayMS(y)
next
      delayms(z)
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//fourth arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14     
                  PORTC = Red_Data(0)
    PORTD = R_ows(3)
     DelayMS(y)
                  PORTC = Red_Data(1)
    PORTD = R_ows(2)
     DelayMS(y)     
                 PORTC = Red_Data(2)
    PORTD = R_ows(1)
     DelayMS(y)
next
      delayms(z)
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// fifth arrow
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For x = 0 To 14     
                 PORTC = Red_Data(0)
    PORTD = R_ows(2)
    DelayMS(y)
                  PORTC = Red_Data(1)
    PORTD = R_ows(1)
    DelayMS(y)     
                 PORTC = Red_Data(2)
    PORTD = R_ows(0)
    DelayMS(y)
Next
   delayms(z)                 
           
End Sub
//SUB ENDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// set ports as outputs
TRISA = %00000000
TRISB = %00000000
TRISC = %00000000       
TRISD = %00000000
count = 0
SetAllDigital

//row = 0
PORTB = 0
PORTC = 0
PORTA = 0
PORTD=0
While true
For count =0 To 5    // run 21 times
// load()
{
RIGHT()                // sub call
DelayMS(50)
Next 
for count = 0 to 5
LEFT()
delayms(50)
next 
 }
//for count = 0 to 5
 
//STOP()
//delayms(50)
//next 
  
// for count = 0 to 5 
STOP()

next 
Wend

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by brad » Fri Oct 19, 2012 6:53 am

I will be posting the 8x8 matrix today, which will enable you to build my circuit and test with my code. Hopefully this will help you figure out what is going on with your 5x7 matrix.

I can see that the big issue at the moment is how you are connecting your matrix. I have tried to find your exact part number but haven't been able to.

Let me know when you get the matrix in the mail and we can experiment from there.

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by MrDEB » Fri Oct 19, 2012 8:36 am

I found a solution to having too many LEDs on with one resistor. I am scaning the CONST array When I have more than one LED per resistor I get dim LEDs so this scan routine has solved my issue. Thinking of doing for the rest of the display but I only have an issue with dim LEDs when more than one LED per resistor(colums). No issues with ROWS but am going to see if I can decrease my current draw by scanning the arrays for the other code sections.

Code: Select all

Sub STOP()

y=15
z = 20   
For x = 0 To 5
                     PORTA = Green_Data(1)
     PORTD = R_ows(1)
     DelaymS(y)
                     PORTA = Green_Data(2)
     PORTD = R_ows(2)
     DelaymS(y)
                     PORTA = Green_Data(3)
     PORTD = R_ows(3)
     DelaymS(y)
                     PORTA = Green_Data(2)
     PORTD = R_ows(4)
     DelaymS(y)
                     PORTA = Green_Data(1)
     PORTD = R_ows(5)
     DelaymS(y)
     Next
   
      //cross bar
     //CROSS
     PORTA = Green_Data(7)  // all on
     PORTD = R_ows(3)     
     // long verticle                   
     DelaymS(75)           // This routine scans the rows from row 2 to 5  
     For s = 1 To 5            //Const R_ows(8) As Byte = (%00000001, %00000010, 
     PORTA = Green_Data(3)     //  %000000100 ,%00001000, %00010000, %00100000, %01000000,%00111110)              
     PORTD = R_ows(s)          // works pretty well and the current draw is acceptal at 16ma ( a green LED = 17.4ma by itself
     delayms(z)
   Next
      
 End Sub

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by MrDEB » Wed Oct 24, 2012 2:01 pm

Had an issue with mixing of routines. First run through all was fine after that routines mixed up the colors. Added a 1000ms delay between and solved the mixing
Here is a video of what I have so far. NO BIG DEAL compared to your projects but got to start somewhere.
Am soldering in the TX/RX modules using header sockets then integrate an interrupt into my code.



http://s992.beta.photobucket.com/user/M ... a.mp4.html

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Bi-Color matrix

Post by brad » Wed Oct 24, 2012 8:32 pm

Cool video - but is there some ghosting happening there with the pixels?

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 13 guests