Beta testers wanted for Charlieplexing Calculator

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
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.
 

Attachments

THE_RB

Joined Feb 11, 2008
5,438
What does the logic table do?

Number of LEDs you can charlieplex from a group of pins is given by the formula;
Rich (BB code):
LEDs = pins * (pins - 1)
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?
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
What does the logic table do?

Number of LEDs you can charlieplex from a group of pins is given by the formula;
Rich (BB code):
LEDs = pins * (pins - 1)
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?

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.



 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
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.
 

THE_RB

Joined Feb 11, 2008
5,438
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?
 

atferrari

Joined Jan 6, 2004
4,771
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.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
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?
You are correct! I forgot to round up. You can't have a fraction of an input. :)

Here is the new table.

 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Hola Spinnaker,

It seems to work OK.
Actually there is a bug. See my response to The RB. I will post an update soon.

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.
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.
 

THE_RB

Joined Feb 11, 2008
5,438
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);

Rich (BB code):
RB0 ---*-----*---------*----------------------------------
       |     |         |                                     
      AV    AV        AV                                        
       |     |         |                                     
RB1 ---*----------*---------------------------------------
       |     |    |    |                                      
      AV     |    |    |                                       
       |     |    |    |                                      
RB2 ---*-----*--------------------------------------------
       |          |    |                                     
      AV         AV    |                                       
       |          |    |                                     
RB3 ---*----------*----*----------------------------------
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
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);

Rich (BB code):
RB0 ---*-----*---------*----------------------------------
       |     |         |                                     
      AV    AV        AV                                        
       |     |         |                                     
RB1 ---*----------*---------------------------------------
       |     |    |    |                                      
      AV     |    |    |                                       
       |     |    |    |                                      
RB2 ---*-----*--------------------------------------------
       |          |    |                                     
      AV         AV    |                                       
       |          |    |                                     
RB3 ---*----------*----*----------------------------------
Thanks. That is the exact feedback I am looking for.

I take a look and make corrections.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Last entry of the 6 is still wrong...
:D

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.
 

Attachments

THE_RB

Joined Feb 11, 2008
5,438
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;
Rich (BB code):
LED0  hi lo -- --
LED1  lo hi -- --
LED2  -- hi lo --
LED3  -- lo hi --
LED4  -- -- hi lo
LED5  -- -- lo hi
LED6  hi -- lo --
LED7  lo -- hi --
LED8  -- hi -- lo
LED9  -- lo -- hi
LED10 hi -- -- lo
LED11 lo -- -- hi
I think using -- for an unconnected pin (input pin) makes it easier to understand (and easier to proof-read it). ;)
 
Last edited:

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
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;
Rich (BB code):
LED0  hi lo -- --
LED1  lo hi -- --
LED2  -- hi lo --
LED3  -- lo hi --
LED4  -- -- hi lo
LED5  -- -- lo hi
LED6  hi -- lo --
LED7  lo -- hi --
LED8  -- hi -- lo
LED9  -- lo -- hi
LED10 hi -- -- lo
LED11 lo -- -- hi
I think using -- for an unconnected pin (input pin) makes it easier to understand (and easier to proof-read it). ;)
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?
 

THE_RB

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

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Just cover every possible combination that has only 1 LO pin and 1 HI pin and the rest of the pins disconnected (inputs).

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.
 

THE_RB

Joined Feb 11, 2008
5,438
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.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
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.
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. :)
 
Top