Shop OBEX P1 Docs P2 Docs Learn Events
Switching Speed — Parallax Forums

Switching Speed

Areal PersonAreal Person Posts: 197
edited 2007-12-20 00:10 in Propeller 1
·
Ok,
·
I’ve built a 3 LED Per Pixel Matrix· of 16x16 Pixels (768 Leds total in 1sq. ft. @ 19mm DOT Pitch) - I’ll send pictures on 12/18/07
·
I’m using the TLC5940 for the16 channel driver (common anode).
·
I had selected the 74HC595N for the anode connection into the TLC5940.
(It takes two(2) IC to switch the 16 anodes)
·
I’m also using the BS2 Functions as follows to latch the channels I’m switching on
e.g. column = %0011110011001101
·
BS2.SHIFTOUT(14, 11, column,BS2#LSBFIRST, 16)
BS2.PULSOUT(12,5)
·
But I’m having problems with the speed of the switching, no matter what I do
I can’t get the flicker out. I’ve tried setting the Propeller clock as fast as it can go.
·
My project looks around 35-40Hz (It’s got a wave in it)
·
QUESTION 1:
Does anyone have any suggestions how I can get a better switching speed ?
Is there a·faster chip I·should try ? Maybe I should use two(2) Propellers
In sync ? (one for the TLC other for the 595) Or is it probably the 595 is just two slow.
·
Here’s the data sheets.
·
Thanks for the help ?
The 595 - ·http://focus.ti.com/lit/ds/symlink/sn74hc595.pdf
The TLC –· http://focus.ti.com/lit/ds/symlink/tlc5940.pdf
·
·
QUESTION 2:
What property determines the switching speed of the 595 ?
Is it· TPD = 13ns or Clock Freq = 6, or 21 MHZ depending on vdd
·
Maybe I should increase the voltage into the 595 from 3.3v to 4.5v ?
·
What do you think ?
·
Thank,
-Areal
·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but

what do you expect ? I'm a programmer.

Comments

  • BTXBTX Posts: 674
    edited 2007-12-17 21:55
    Areal.

    First: change the BS2 functions by propeller assembly. (after that, you will need to send the data to the TLC faster and faster)

    Seccond: I told you... I don't think that you will·get the·matrix working well without using 16*3 TLC's in each matrix...forget the 595's..or continue trying & good luck.

    Third: Maximun operating frequency of SCK = 30 Mhz. for HC595.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-17 22:09
    Look here:
    PUB PULSOUT(Pin,Duration)  | clkcycles
    {{
       Produces an opposite pulse on the pin for the duration in 2uS increments
       Smallest value is 10 at clkfreq = 80Mhz
       Largest value is around 50 seconds at 80Mhz.
         BS2.Pulsout(500)   ' 1 mS pulse
    }}
      ClkCycles := (Duration * us * 2 - 1250) #> cntMin        ' duration * clk cycles for 2us
                                                               ' - inst. time, min cntMin
      dira[noparse][[/noparse]pin]~~                                              ' Set to output                                         
      !outa[noparse][[/noparse]pin]                                               ' set to opposite state
      waitcnt(clkcycles + cnt)                                 ' wait until clk gets there 
      !outa[noparse][[/noparse]pin]
    



    As cntMin is 400 this is not consistent however... so your pulse will be 5 µs...

    The SHIFTOUT takes 1 ms/16 bits.... When you shift-out for 16 rows (?) your refresh will be 1/16ms = 60 Hz.

    Maybe there is essentially more SPIN code (complex computations?) than you show us in the main loop?

    An easy improvement will be to change the wait time in BS2; look here
    PUB SHIFTOUT (Dpin, Cpin, Value, Mode, Bits)| bitNum
    {{
       Shift data out, master clock, for mode use ObjName#LSBFIRST, #MSBFIRST
       Clock rate is ~16Kbps.  Use at 80MHz only is recommended.
         BS2.SHIFTOUT(5,6,"B",BS2#LSBFIRST,8)
    }}
        outa[noparse][[/noparse]Dpin]:=0                                          ' Data pin = 0
        dira[noparse][[/noparse]Dpin]~~                                           ' Set data as output
        outa[noparse][[/noparse]Cpin]:=0
        dira[noparse][[/noparse]Cpin]~~
    
        If Mode == LSBFIRST                                    ' Send LSB first    
           REPEAT Bits
              outa[noparse][[/noparse]Dpin] := Value                              ' Set output
              Value := Value >> 1                              ' Shift value right
              !outa[noparse][[/noparse]Cpin]                                      ' cycle clock
              !outa[noparse][[/noparse]Cpin]
              waitcnt(1000 + cnt)                              ' delay
    
        elseIf Mode == MSBFIRST                                ' Send MSB first               
           REPEAT Bits                                                                
              outa[noparse][[/noparse]Dpin] := Value >> (bits-1)                  ' Set output           
              Value := Value << 1                              ' Shift value right    
              !outa[noparse][[/noparse]Cpin]                                      ' cycle clock          
              !outa[noparse][[/noparse]Cpin]                                                             
              waitcnt(1000 + cnt)                              ' delay                
        outa[noparse][[/noparse]Dpin]~                                            ' Set data to low
    



    Change the waitcnt (1000+cnt) to 500 or omit the waitcnt totally!
  • Areal PersonAreal Person Posts: 197
    edited 2007-12-17 22:16
    @deSilva

    Thanks dude !

    Thats a good place for me to start !

    Thanks BTX !

    -Areal

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I have a tree growing out of my head, but

    what do you expect ? I'm a programmer.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-12-18 12:48
    Areal Person -

    I wasn't following the hardware details you were talking about. Can you post a sketch or schematic? I also eager to see a picture because it sounds like you are controlling a boat load of LEDs.

    What I can help you with is to point out that the problem isn't the TLC5940 nor is it the Propeller that is your problem. My guess is that it is software or the interface chip logic you have. Check out the other thread regarding the DMX LED bookcase in my living room. This design uses one Prop and 6 TLC5940 (3 per column each column with one chip for red, one for green and one for blue).

    There is some good code on the forum for controlling the TLC5940. I also created code that I will be posting soon. My code is mostly in SPIN because I didn't need a super fast update. It shouldn't be too hard for me to convert it to ASM when and if I need to.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • BTXBTX Posts: 674
    edited 2007-12-18 13:43
    Timothy.
    He's going to build a big LED screen in modules of 16 by 16 pixeles each.
    If I'm not wrong, he want to use three TLC's for each module multiplexing each·column, ... I think·maybe the TLC's will not work correctly at that situation, also the TLC data would be refreshed at a very high speed, to get the modul working with "video" at a 30 fps or even at 15 fps.

    I think too, that 48 TLC's could be the best choice for that...... although not the cheapest. smile.gif I was looking inside some comercial LED screen at many shows....and then uses that method, lot of chips per module, linked by a dedicated board between them, and finally linked by ethernet.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-12-18 14:27
    If you are doing video the TLC5940 is capable. High speed is the king - ASM all the way baby! There are other chips out there too for this application.

    Thanks for the details BTX.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • kevin101kevin101 Posts: 55
    edited 2007-12-20 00:10
    You could use a MC14028B to drive the anodes and use a I/O expander to drive the BCD inputs. I doubt it is fast enough or sources enough current (25 ma), but its just an idea.

    bored out of my mind waiting for my prop
    kevin
Sign In or Register to comment.