Go Down

Topic: Unlimited I/O pins (Read 3 times) previous topic - next topic

Paulware

I would like to make a shield that will use 2 4051 multiplexers and 1 tlc5940 led driver

The tlc5940 is awesome because it has a serial output and serial input pin.  By connected the serial output to the serial input of the "next" tlc5940 you can daisy chain them together to create as many pwm digital outputs as you like. 

The 4051 allows you to select one out of eight inputs using 3 digital selection inputs.  It also has an enable pin.  The output of this device can be fed directly into one of the arduino analog inputs (say a0).

The tlc5940 has 16 outputs, but 3 of those will be fed into the 2 4051s to select which input is desired, 2 more tlc5940 outputs will used to populate the enable pins on the 2 4051s allowing us to inhibit one or both of them.  This leaves 11 pwm outputs which can be used to drive external components.

So each shield will give you 11 additional pwm digital outputs and allow you to read 16 additional analog inputs. 

By connecting the serial output of the tlc5940 to a jumper wire connected to a male header, you can use this "optional" pin to connect to the next shield in the stack.  Each shield must have serial input broken out as a female header.  The first one in the stack however, will gets its serial input from the arduino (D?).  I think this should be accomplished by a dip switch to connect the serial input to the Arduino digital output. 

So n shields should be stackable allowing for n*11 additional digital outputs and n*16 additional analog inputs.

Schematics and code will follow.  This will be totally open.   

Graynomad

Quote
Schematics and code will follow.

Look forward to criticising commenting :)

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Paulware

#2
Jul 01, 2012, 06:28 am Last Edit: Jul 01, 2012, 09:43 pm by Paulware Reason: 1
Here is a link to the schematic and board.  

http://atmega.site40.net/default.php?bookmark=#Unlimited IO  Give it a minute to load...it is slow

I haven't ordered a board from the schematic yet.  The board fits within 5cm x 5cm, even though the arduino pins are slightly bigger.  This keeps the board cost down to $14.00 for 10, from www.iteadstudio.com.

Please start throwing stones comment.

Much appreciated....

Paul

Hey grey nomad, I checked out your website...retired at 45...impressive :)  I already missed that mark

Graynomad

Quote
retired at 45...impressive

He he, not hard to do if you don't have kids, do well in the IT industry and live frugally.

Re the board, I don't see a tlc5490, where is that?

What are the two headers on the right?

There are no component designators on the PCB so it's hard to determine what headers are what.

Apart from that the board looks OK, you web site skills need some work though :)

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Paulware

#4
Jul 03, 2012, 02:03 am Last Edit: Jul 03, 2012, 03:14 am by Paulware Reason: 1
I was able to find a real eagle definition of a tlc5940 from their user posted libraries.  I replaced the 2 x 16 connectors with the actual tlc5940.  I also downloaded the latest eagle 6.2.0 so this schematic will only load in that latest version.  Going to order a board today.  Where do you think I should put the eventual library.  SourceForge, Github, or just keep it in a .zip file until its ripe mature? 

Thanks

By the way the web-page is actually a wiki which allows an author to update the page online, and tailored to show parts/prices/datasheets and where to get them.  So its rather fancy under the hood, although what is displayed to the user is kind of primitive.  Going to speed it up soon.

Paulware

If anyone would like to help with the library, I can mail out a free shield pcb.  You will have to come up with your own 4051s (about 45 cents each at mouser) and tlc5940 (about $4.00 ouch at mouser...cheaper in groups of 5 in ebay).  I should have 9 extra pcbs when the order arrives in about 3 weeks. 
Thanks

Graynomad

Quote
I replaced the 2 x 16 connectors with the actual tlc5940.

Then we can hardly comment on the PCB design eh? And it's also not in the schematic I think.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Paulware

#7
Jul 03, 2012, 02:38 pm Last Edit: Jul 03, 2012, 03:12 pm by Paulware Reason: 1
Please check it again, you can see from the board picture, it has changed...thanks

Graynomad

I see you are using D11 for serial, that is also MOSI and so will stop this shield from being used with many other shields.

I hope you are using the auto router as no human could do such a crap job of running the traces :)

I get that you want to daisy-chain the 5940s by passing the serial up the stack, but I'm not convinced your circuit does that.

SERIALIN and SERIALOUT of all boards are simply connected together, throw that DIP switch and all SERINs are connected to D11.

Normally with this setup you offset the signals, eg  JP3:1 is SERIALOUT on a bottom board and SERIALIN on the board above it. This cannot be achieved with a backplane that uses PTH sockets because that forces every signal to be the same on every board. You need to use surface mount headers so pin X on a bottom board has a different signal to pin X on a top board.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Paulware

Made a mockup to explain use of dip-switch on D11.  Inputs and outputs are in the horizontal plane (disregard "vertical" in video)

http://www.youtube.com/watch?v=lMga2TR6oGI&feature=plcp



Grumpy_Mike

Quote
The tlc5940 has 16 outputs, but 3 of those will be fed into the 2 4051s to select which input is desired, 2 more tlc5940 outputs will used to populate the enable pins on the 2 4051s allowing us to inhibit one or both of them

that is not going to work. The outputs of a TLC chip are PWM current sinks, these are not sutiable for feeding into 4051.

Paulware

1) Thanks for your insight.  Is there a way to connect something to the 5 outputs of the tlc5940 that would make it compatible with the 4051?

  2) I noticed that the tlc5940 is rather pricey.  Is there another led driver or digital output/io expander that I could use that:
    a) cheaper
    b) has a serial out/serial in so that I can daisy chain them
    c) be suitable to drive 4051.


3) Or alternately is there another mux or analog input expander besides the 4051 that I could use that could be connected to the tlc5940?

4) Or last question:  I read in a forum that the tlc5940 can also be used as a mux.  If I want to daisy chain shields together, do you think it would be possible to configure tlc5940 has analog inputs and pwm outputs?

Thanks.

Graynomad

Just maybe the 5490 will provide a stable output on your MUX control pins if you set a pin's grey scale to 0 or 4095. It's not spec'd one way or another in the data sheet though so I wouldn't make a PCB on that assumption. Even if there are small glitches you may be able to filter them out.

There are lots of IO expanders that will do similar but I don't know if many to the PWM bit though. Is PWM important?

What about the daisy-chaining, are you happy that will work?

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Paulware

PWM is nice, not essential.
Not sure if you are asking me or Mike about the daisy-chaining.  I believe it will work and is essential to make the shields stackable.  Unless you have a better idea :)

Graynomad

Quote
PWM is nice, not essential.

Then there are 100s of IO expander chips, start by looking at the MCP23017.

Quote
about the daisy-chaining

I went on at some length about it in post #8 and I may be wrong, but if you're happy then so am I :)

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up