Shop OBEX P1 Docs P2 Docs Learn Events
SX28 and Hex D Flip Flops — Parallax Forums

SX28 and Hex D Flip Flops

BigKBigK Posts: 7
edited 2007-10-02 05:45 in General Discussion
Hello,

I am new to forum so be easy!

I am wanting to use the SX28 to control a matrix of leds. I have seen a few differnt schematics that use Hex D flip Flops to control the ground lines of the matrix and wondered why they use those and also how they work.

I am wanting to put together a 5x7 matrix but not just a single led but 6 or 8 in series parallel configuration. I plan on using a ULN2803 to drive the leds from the processor. My other question is what is the best Hex D Flip Flop to use since my current is going to be 40ma on each series parallel led setup?

Any suggestions appreciated!
Thanks!

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-09-27 16:09
    Everyone knows Ohm's Law E = IxR but forgets about Watt's P = IxR

    The ULN2803 may not be as good a separate transistors when you start mutiplexing strings of LEDs.

    It is a neat little device, but by putting 8 lines in one package they share the heat build up. And Darlingtons run a lot hotter because are really two transistors together.· You need to dump the heat along the way in individual packages.

    I suppose the Hex D flip-flops serve a couple of purposes. They provide a switch outside of the microprocessor that can handle a bit more power and heat. And depending on how they are used, they can cascade and reduce several microcontrol lines down to one clock line.

    As mentioned above, there are lots of matrix projects. Mostly because there are different ways to do LED matrix and each has its own pro and con.

    I suspect it is best to start with one matrix and generate indivdual characters that spell out a message. The n figure out how to scroll Down. Then figure out how to scroll Right. After all that, you can move on to bigger grids or banners.

    But as your project grows, the P in Watt's equation grows exponentially. You will have to figure out a lot of tricks fo the trade to drive all that current drain to the right places.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-09-27 17:52
    I agree with Kramer. Once you see that the ULN2803 is only good for about 8x8 LED matrixes. Anything larger will require much more current availability. This means you can still use the ULN2803's on the column cathodes BUT you will need something like P chanel MosFETs to "turn on" to full current brightness all of the anodes. I have attached·some example documents that I·put together·on my past practices that should be helpfull to get you going. Ask away at any other questions.



    PS: Let me know if you don't have Microsoft Word and I will convert it to something else.
  • BigKBigK Posts: 7
    edited 2007-09-27 22:03
    Thanks guys for the info!

    What I am wanting to do is a table with a 5x7 display built in. I can change the ULN2803 to the PN200 or etc. that can handle the current but still need something to replace the 74lS138. This comes from a schematic I saw minus the 2803. I knew I would have to use something else since I was going to use more leds.

    Does anyone have a suggestion to replace the 74ls138 so it will handle the 40ma sink per led segment that I need?

    Thanks,

    K


    Post Edited (BigK) : 9/27/2007 10:22:49 PM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-09-28 00:03
    Can you post the schematic? I would be interested in seeing if there is a better way. Remember the 74HC138 will have an individual low output (1 of 8). You can use many different methods but seeing the end idea would really help.

    I have found that on the LED cathodes one can use any of the following (depending on how the hardware and software is dealt with): (highs in, lows out for the cathodes) UDN2803, A6821 (serial version of UDN2803 - much like a high powered 74HC595 with inverted outputs), etc.

    If you use UDN2803's then you will need to drive them with something like 74HC595s, 4017 & 4081 combos, or direct with lots of I/O like a Parallax·SX-48 microcontroller. If you use UDN2803's you will ultimately have lots of chips because you still have to reduce the I/O to something that the microcontroller has. However if you are only talking about 1-3 5x7 matrixs then you can use the I/O from an SX directly through the UDN2803's.

    My preference is to use the serial version being the Allegro Microsystems A6821 which only needs 3 inputs can provide the same 500 mA per output that the UDN2803. Less chips to deal with and they cascade easily. You can use SHIFTOUT statements for this type of SPI design.

    Now for the LED matrix Anodes, you can use ULN2881/2/3 (that's right ULN not UDN) they give the parrallel outputs just like the UDN2803's but they take lows in to give highs out to the anodes. Just the opposite of the UDN2803s. You can also use Pn200's on the Anodes. However, you will soon find out that your LEDs just wont be all that bright UNLESS you allow more current to flow. This is when P channel FETS come into play. Use them on the Anodes.

    You will also need a higher current power supply 5vdc. If you use a higher voltage· and higher current (3-5 amps) like 12 vdc , then you will also need to add N channel FETS to the P channel FETS - gets a bit complicated doing it this way. I try to stay with 5vdc for everything.

    Another approach entirely is to use the popular MAX7219 which used SPI (SHIFTOUT command) for lighting up all 64 LEDs per led matrix. You can cascade them using a Basic Stamp 2 if you like.

    You may also want to look into a complete solution by Sparkfun.com. I had a link to them previously. They sell bi colored LED matrixs AND controllers as well as RGB LED matrixs and controllers. They are a bit pricey but all the hardware design is done for you and it is somewhat simple to write the microcontroller software (SX chip or Basic Stamp 2). I can help with that.

    Many other possibilities exist but lets see your schematic design and criteria for using this or can anything be changed on it.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-09-28 00:57
    Y'know, I think that this guy is really onto something here -- http://forums.parallax.com/showthread.php?p=661543
    ·
  • BigKBigK Posts: 7
    edited 2007-09-29 03:00
    PJAllen,

    What controls the column switching, I didn't see that in the schematic info?

    You guys have posted some great info, thanks!

    Is there a NPN equivelent to the PN200?

    What I can do is use PN200 on switching the ground side of the leds and the NPN's from the SX28 outputs.

    I have posted the schematic but it is using a pic and I want to use the SX28.

    Can all of this be controlled from the SX28 since it has enough I/O's without having to use a decoder chip?

    The schematic is attached but the 74ls174 should be a 74ls138!

    Thanks,

    K
    1170 x 855 - 84K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-09-29 03:50
    The Columns·(each 1 of 5), in my Project, sink through the 2803 [noparse][[/noparse]see _p2, RC.0-RC.4]·and the Row·data comes out of the transistors [noparse][[/noparse]see _p1].· The Column enabling is derived from software (the program.)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-09-30 17:52
    P. J.,
    You have got me hooked. I am going to have to build one of those 5X7 displays as the 'swimmer' graphic animation is brilliantly simple. It is really hypnotic and special.

    I'm sure an SX28 can do it with room to spare for additional items' such as·a trigger input, speed change·input, and/or·reverse the direction reverse.· I still have some of the SX18 chips with 12 I/O pins and I can even use the SXes'·internal oscillator to knock the pin count way down.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 9/30/2007 6:26:45 PM GMT
  • BigKBigK Posts: 7
    edited 2007-10-01 01:42
    PJ



    What is the reason for the LM339?



    K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-10-01 02:35
    The comparators composing the LM339 provide the "conversion" for the higher output voltage required for the LEDs (matrix) that I used, their forward voltage was 6.5V (which is greater than an SX's 5V max).· The transistors on the LM339·outputs are emitter-followers, output·volts = voltage in (9V) - 0.7V, and they can deliver a lot of current.· This way all of the "heavy lifting" is done by the transistors and not by the SX outputs.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-10-01 08:14
    The LM339s are also controlled by a 50K pot that nicely allows you to adjust the brightness of the display. By getting this taken care of at the hardware front end of the amplifications stages with a comparitor, you don't have to rebuild your circuitry if it is too dim or pulling a potentially damaging level of power - just tweak the pot.

    There are two ways to control brightness - in software by controlling the duty cycle AND in hardware by a scheme such as this. Avoiding having to fine tune brightness in software gives you more programing space to do other things. It also allows you to start out with a dim display and protect it from potential damage due to a miscalculation in software.

    It is a very intelligent design.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-10-01 11:21
    Kramer said...
    The LM339s are also controlled by a 50K pot that nicely allows you to adjust the brightness of the display.
    Sorry, but not so.· The 50K pot establishes the comparators' threshold voltage (VTH).
    Variable brightness could be easily incorporated by using a variable voltage regulator (LM317) in place of the fixed 9V (7809) that I used.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-10-01 12:14
    I stand corrected. Thanks P.J.

    But since the negative input of the comparitor is controlled by 50K pot, wouldn't it have some affect on the overall output timing? Or is the rise time of the square wave so fast that it doesn't really have an impact?

    The heart of the issue is that matrices of LEDs do require some in depth thought about power consumption and duty cycle. The LEDs are driven at a high voltage but for a fraction of the time. And the rate is so fast that it looks at if it is constantly on.

    Not all matrices are the same. I just picked up a jumbo 5X7 to copy the circuity. But if someone was to use a smaller sized 5X7, the voltages and overall power would require redesign as the smaller LEDs use less.

    And the matrices also come in Common Anode or Common Cathode. I am just hoping I've got the same one as the schematic. If not, I have to adapt the design for the opposite polarity.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-10-02 00:43
    Kramer said...
    Or is the rise time of the square wave so fast that it doesn't really have an impact?
    · That's pretty much the way that I see it.· At these frequencies/times, all that's negligible.

    · When selecting a matrix, one needs to determine whether they're cathode row w/ anode columns·or cathode columns w/ anode rows (the common anode vs·common cathode distinction is for alphanumerics, segmented displays.)·

    · Does everyone reckon columns and rows the same as I do?· To me, a row consists of 5·horizontal elements and a column consists of 7 vertical elements (therefore 7 rows and 5 columns.)· But others might see it the other way.· So, as I see it, my matrix is cathode columns w/ anode rows.

    · Sometimes...·you gotta work with what you got.

    · With 8x8s, this is not a consideration.· :)
  • BigKBigK Posts: 7
    edited 2007-10-02 00:47
    I found these while looking around for a matrix to play with on the bench

    http://www.futurlec.com/LEDMatrix.shtml
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-10-02 01:01
    I have ordered these a couple of times on Ebay. Bi-Colored LEDs from China. 10 8x8 for under $20 including shipping costs.

    http://cgi.ebay.com/10pcs-8x8-Dot-Matrix-3mm-dia-Bicolor-LED-Display_W0QQitemZ230175550122QQihZ013QQcategoryZ26207QQssPageNameZWDVWQQrdZ1QQcmdZViewItem

    Also there is SparkFun but more costly:

    http://www.sparkfun.com/commerce/categories.php?cPath=51_89
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-10-02 05:45
    I try to buy over-the-counter locally in Taiwan, but I never know if I'm getting common anode or common cathode because the guy at the counter doesn't understand the difference. I have to just power up the LEDs and figure which direction they are going.

    One may have similar experience when buying at a very good price on E-Bay. If you can adapt to it, it is worth the savings.

    I really like futurelec's product inventory and prices. Yet, a lot of people don't like the delays they encounter with orders as they ship from Australia, China, and Thailand. It takes weeks for them to round up and ship out an order. And yet, looking at their 5X7 jumbo matrices, I see square LEDs for the first time. They have genuine depth in inventory for the DIYer. And they have PDF info on most chips right within the web site.

    Sparkfun is great when it has the product, but it doesn't seem to carry all and everything - just is the most popular and exotic devices that really are fun and fly off their shelves. They are a very well priced jobber for printed circuit boards in short runs on Eagle. Someone in China does their boards and ships directly to you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Sign In or Register to comment.