Pages: 1 2 [3] 4 5   Go Down
Author Topic: Daisy-chaining 7 IC's  (Read 4759 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 513
Posts: 26247
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: November 09, 2012, 01:19:53 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.)
« Last Edit: November 09, 2012, 01:21:56 am by Nofew » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 513
Posts: 26247
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

976.5625Hz is less than 1000 Hz. Not sure how GHz came out of that.

Use 2 transistors to make non-inverting buffer.


* buffer.jpg (26.18 KB, 960x720 - viewed 21 times.)
« Last Edit: November 09, 2012, 01:31:36 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 513
Posts: 26247
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 513
Posts: 26247
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: November 09, 2012, 02:14:54 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: 1 2 [3] 4 5   Go Up
Jump to: