I’m working on a project that has ICs daisy chained together through SPI… and for the life of me I cannot get them to communicate robustly. After many hours, I’ve reduced all of my problems to the grounding scheme I’ve used for my project. I’ve attached a simple schematic showing my current wiring scheme so we are all on the same page. I also know I’ve written a lot of text here, so I’ve bolded my questions to make it a little easier haha. Thank you for your patience and help.
So the first thing you might notice is how the ICs are wired to power and ground. I went with this scheme for 2 reasons:
- I cannot daisy chain the power for too many ICs. The amount of current builds up with each IC in the chain, and the 22AWG wires and PCB traces cannot support that much current.
- I was somewhat lazy, and didn’t want to spend a week creating individual power cables that split off of the main 14AWG branch and route to each of the 60 connected ICs.
This is where my first problem comes in. I believe that splitting the large SPI daisy chain into smaller sub-chains for power are influencing the SPI communications (the data gets garbled) due to different ground potentials at each IC. Is this method of splitting the power bad, and if so, why?
I saw a blog post the other day where a guy had done daisy chain ground wiring exactly the way I have… and he found that by connecting the end of the chain back to the main ground line fixed it. For example, in my schematic connect A and D back up to the main 14AWG ground line. I tried this and the SPI comms improved… but doesn’t this create ground loops?
I’m thinking that I should just bite the bullet and wire an individual ground to each IC from the main branch, but that will take a lot of work. I want to check with some electrical experts before starting so I don’t waste my time. Thoughts?
Now my second problem is grounding the Arduino so that it can communicate with the ICs over the SPI line. Currently, I have the Arduino ground wired to the 14AWG main branch outside of the project enclosure. This does not work; the SPI data gets all garbled. If I open the enclosure and attach the ground to the main branch but very close to the ICs, it does work. Why does the length of ground wire matter so much in this application?
In the current setup, I have to attach an Arduino ground to the main branch because the Arduino is being powered by my Laptop. I understand this creates a ground loop, which I believe may be the answer to my previous question. If I power the Arduino directly from the 14AWG main branch, I believe I can eliminate the ground loop. I’m going to try this when I get home, but do you guys think this will help?
Finally, if powering the Arduino from the same supply as the ICs won’t work, I believe I will need an isolator for the SPI lines. Do you guys know of any isolators good for 1-4MHz SPI?
Thanks again for all of your help guys, and sorry for the long first post. I had so many questions and wanted to make sure you guys had all the details you needed.