Beta testers wanted for Charlieplexing Calculator

Discussion in 'Embedded Systems and Microcontrollers' started by spinnaker, Nov 28, 2009.

  1. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    I have been reading about Charlieplexing but I have not actually tried it yet. I thought a big help would be to have a logic table for the number of LEDs that you want. Doing it by hand would be tedious so I created a Charlieplexing calculator.

    It is attached below. It is written in C# .Net. Hopefully You have all the needed dependencies already loaded.

    Please test the program and tell me what you think. Please make sure I have the table correct. If you have suggestions on improving it please speak up.

    One idea I had would be to have it produce a wiring chart for the LEDs. But I am but exactly sure how to proceed. There has to be some logic involved there but I have not figured it out yet. Please let me know if you have any suggestions.

    Another idea is for export to a CSV file.

    If people like this and I can find a free site to host servlets then perhaps I will port it to Java.
     
  2. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    What does the logic table do?

    Number of LEDs you can charlieplex from a group of pins is given by the formula;
    Code ( (Unknown Language)):
    1.  
    2. LEDs = pins * (pins - 1)
    3.  
    I'm sure I posted that formula on this forum earlier.

    I hate un-zipping stuff (viruses etc) can you post your table as a .GIF or .PNG image etc?
     
  3. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988

    The logic table shows what address bits need to be set to turn on a given LED. It also calculated the number of pins needed or the number of LEDs possible for a given number of inputs.

    I assure you the exe is virus free. I compiled it. If you don't trust me you could always scan it yourself. How do you get any software? Most comes from the internet these days.

    Here is a sample table. I told it I wanted 10 LEDs and it calculated the number of bits I need. It also shows the logic table to light the various LEDs.



    [​IMG]
     
  4. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    OK I can see why people might not want to run software from a non trusted source. But I can be trusted. :)

    Actually I another have a software product that I wrote and sell from my website.

    It is costs extra to be able to run servlets on my providers server. I never really had the need so don't pay the extra cost. I think I might try to find a free hosting company and port this to Java, people think it would be useful.
     
  5. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Thanks for posting the image of the table.

    I have a question, as far as I know you can only get 6 leds from 3 micro pins, (these are the first 6 entries in your table). How do the last 4 entries work? Do you have a schematic?
     
  6. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,644
    759
    Hola Spinnaker,

    It seems to work OK. Is it any way to add a schematic showing the selected amount of LEDs and the related pins? Not that I cannot work it out but to complement a useful calculator like yours it would be good.

    Thanks for sharing.
     
  7. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    You are correct! I forgot to round up. You can't have a fraction of an input. :)

    Here is the new table.

    [​IMG]
     
  8. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    Actually there is a bug. See my response to The RB. I will post an update soon.

    I already had that idea. Actually I thought an easier way program wise would be to create a wiring punch list. I am new to PICs and for sure new to Charlieplexing so I have not yet figured what the logical sequence to wiring a Charlieplexed array.

    If someone could give a sample of several how several LEDs are wired (not a schematic but step by step instructions) , I am sure I will be able to code it.

    Perhaps in a version down the road, I might be able to get it to draw an actual schematic though I am not all that good at graphic programming.
     
  9. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    You've got another bug. ;)

    When charlieplexing you should only have 2 PIC pins activated at any time, one HIGH and one LOW. All other pins should be set to inputs.

    You last table is still wrong. :)

    Probably the best way to draw a charlieplexed array is with the PIC pins shown as long horizontal lines, and the leds (in pairs) drawn vertically, and between every 2 PIC pins there is a pair of 2 LEDs.

    It only took a couple fo minutes to draw this one in text, just imagine that AV is two LEDs in a pair (reversed);

    Code ( (Unknown Language)):
    1.  
    2. RB0 ---*-----*---------*----------------------------------
    3.        |     |         |                                    
    4.       AV    AV        AV                                        
    5.        |     |         |                                    
    6. RB1 ---*----------*---------------------------------------
    7.        |     |    |    |                                      
    8.       AV     |    |    |                                      
    9.        |     |    |    |                                      
    10. RB2 ---*-----*--------------------------------------------
    11.        |          |    |                                    
    12.       AV         AV    |                                      
    13.        |          |    |                                    
    14. RB3 ---*----------*----*----------------------------------
    15.  
     
  10. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    Thanks. That is the exact feedback I am looking for.

    I take a look and make corrections.
     
  11. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    OK I have an update hope I am on the right track

    [​IMG]
     
  12. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Last entry of the 6 is still wrong...
    :D
     
  13. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988

    This is going to be harder to program than I thought. But I think I might be starting to grasp the concept.


    Maybe the 3rd time is the charm, or is it the fourth time.


    This is for 6 LEDs. I found a similar sample table for 6 and seems to check out.

    I have not found anything larger. What would 7 look like? I think I might have it but want to be sure.
     
  14. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    If you go to 7 LED you need 4 pins.
    Maximum LEDs for 4 pins is given by the formula I posted at the top of the thread;

    LEDs = pins * (pins - 1)
    LEDs = 4 * (4-1)
    LEDs = 4 * 3
    LEDs = 12

    So there will be 12 table entries for 4 pins, here is a sample;
    Code ( (Unknown Language)):
    1.  
    2. LED0  hi lo -- --
    3. LED1  lo hi -- --
    4. LED2  -- hi lo --
    5. LED3  -- lo hi --
    6. LED4  -- -- hi lo
    7. LED5  -- -- lo hi
    8. LED6  hi -- lo --
    9. LED7  lo -- hi --
    10. LED8  -- hi -- lo
    11. LED9  -- lo -- hi
    12. LED10 hi -- -- lo
    13. LED11 lo -- -- hi
    14.  
    I think using -- for an unconnected pin (input pin) makes it easier to understand (and easier to proof-read it). ;)
     
    Last edited: Dec 14, 2009
  15. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    OK I give up. I am seeing a pattern here kind of. I know the answer is right in front of me but I am just not seeing it. Can you give me a hint on how to buld this table?
     
  16. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Just cover every possible combination that has only 1 LO pin and 1 HI pin and the rest of the pins disconnected (inputs).
     
  17. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988

    Yes easy to say and write down. Harder to program. :) It is pretty simple when You have only 2 states. But tri state is a bit more difficult. At least for me.
     
  18. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    Very sorry, still not understanding this. Can you post some pseudo code?
     
  19. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Sure I could, but i've helped a heap already and this software is *your* baby. :)

    Maybe if you post a sample of the procedure you are using people might offer suggestions.
     
  20. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    Sorry I have been working on about 3 different projects. That last post did not even belong in this forum!!!! :)

    I have got to stop working so late (or actually early). Posted that thing in the wee hours of the morning. :)
     
Loading...