Go Down

Topic: Daisy-chaining 7 IC's (Read 6259 times) previous topic - next topic

Nofew

Well, I knew that, but I figured "Somewhere between 0 and 16 mhz" wasn't very helpful.

This might be: Under "normal" circumstances I'm sending 20 events a second, and each event has 128 parameters. I still don't know how fast that is exactly but it's a start.

CrossRoads

So slow it down to 10 events a second, if things suddenly dramatically improve then you know you have too much going on.
You have to send out 192s/device * 7 devices = 1344 bits of data.
Say the SPI clock was running at 1/4 speed, or 4 MHz. Then each bit takes 250uS x 1344 bits = 0.336mS
You are sending data out 20 times/second, or 50mS. So there's 49.6 mS for the code to do whatever it does, which seems like a lot of time.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Nofew

Just tried that. Even at 1 event per second it's not working properly. Most of the LED's respond properly but a few scattered over the entire display (not just one chip anymore) don't listen. Weirder yet, they switch even when I don't tell them anything. LED's aren't flickering; they're just randomly deciding to change state. I'm not touching the wires or anything. It just happens.

I'm pretty sure it's not a clocking issue. The library supports "infinite" tlc5940's chained together. I think the speed limit is set within the library so even if I tried to send more than they can handle it wouldn't happen. On top of that, they have 30 mhz clocks. Finally, the events are not evenly spaces. They're sent as fast as the library will allow. What I'm getting at is, if it was a clock issue, it'd have been showing its self when I added the first chip.

Graynomad

#33
Nov 09, 2012, 07:17 am Last Edit: Nov 09, 2012, 07:19 am by Graynomad Reason: 1
I'm thinking about the speed of transmission as well, if it is 8MHz maybe that's too fast for the long wires and breadboards or whatever you are using.

You can lower the speed of the SPI port, I can't remember what register to write into but I'll have a look. Maybe someone else knows of the top of their head.

Quote
I thought about using transistors. 2N2222 claims to only run up to 300 mhz but I tried it anyway.
The 5490 is only rated at ~30MHz, so the transistor is 10x faster. Your problem was more likely the inversion caused by the transistor.

I read some of the library files, I can see no mention of 1GHz anywhere, can you point to the reference?. Anyway, trust us, there is no way on God's earth this sort of thing runs at that speed.

EDIT:
Quote
it'd have been showing its self when I added the first chip.

Not necessarily, more chips + more wires + more breadboards = more capacitance = slower clocks required.

You can send data once a week but if you send it too fast that can still be a problem.

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

Nofew

#34
Nov 09, 2012, 07:19 am Last Edit: Nov 09, 2012, 07:21 am by Nofew Reason: 1
My bad, I meant 300 hz, not mhz, for the 2N2222. Got so used to typing "mhz" that I didn't notice. My bad.

I already pointed to the reference. "\note The default of 8192 means the PWM frequency is 976.5625Hz */".


EDIT: I'd still like to try using transistors. Inversion makes sense since I have the "BLANK" line going through it. Is there a magical way to fix inversion? Do I just hang the chip up-side down? (Canned laughter here, please.)

CrossRoads

#35
Nov 09, 2012, 07:25 am Last Edit: Nov 09, 2012, 07:31 am by CrossRoads Reason: 1
976.5625Hz is less than 1000 Hz. Not sure how GHz came out of that.

Use 2 transistors to make non-inverting buffer.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Nofew

...There I misread "hz" as "mhz". See above.

I don't have ten 2N2222's. Would it be 'kay if I mixed them with transistors of a different type that run at 150 hz? Or is that pushing things?

CrossRoads

As your signals are relatively slow, I think mixing transistors would probably be fine.

Instead of daisy chaining control signals, you might also try feeding each one direct from the source.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Nofew

I'll try getting transistors happy then, but it'd help if I knew what wires to stick where. I'm Googling stuff but it's bringing up not-so-useful results.

I can't control each IC directly. I'd need a total of 28 PWM pins to do that. (4 PWM pins per IC, 7 IC's).

CrossRoads

No, instead of daisy chaining, make like a star-distribution from the control pin to the 7 end points.

Can't help you with the buffer, you need to look up the data sheets for your transistor and determine the base/emitter/collector.  No mind readers here!
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Graynomad

Yes, getting rid of the daisy-chained clock may help, and try adding this to your setup()

SPCR |= 3;

That should slow down the transmission speed.

But don't do both at once :)

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

Nofew

Ah. Okay, I can try that. I should have /just/ enough wires and a spare breadboard somewhere.. If that don't work I'll try changing the SPI's speed.

But what do I hook where? Do I stick the second transistor's collector to the first's emitter and tie the second's base to a constant +5v source?

Graynomad

I still doubt you need buffering at all, but I don't think it can be any clearer than Crossroad's schematic except there's no R values.

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

Nofew

I LOVE YOU GUYS. o_o...

I thought of doing a bus/star formation earlier but thought it was a stupid idea. I guess I severely underestimated how much wires can screw with data. It works perfectly now! Even my tests that do far more than I'd ever do when sequenced with music (Just constant events, no delays anywhere) don't throw them off now! Gosh. Wow.

For future reference, what kinda wire should I be buying? Larger or smaller gauge? Solid or stranded?

Graynomad

#44
Nov 09, 2012, 08:12 am Last Edit: Nov 09, 2012, 08:14 am by Graynomad Reason: 1
Good stuff, remember you still have the option to slow the speed. That may allow you to go back to a daisy chain if that's easier to wire.

For breadboarding I use solid, for permanent I use stranded normally, I doubt the gauge matters for the data.

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

Go Up