AD7706 SPI issue with Arduino - Page 1
Forum section: electronics / beginners

author: Martin7850
author_rank: Newbie
timestamp: March 13, 2017, 10:15:19 pm
content: Hi there,This is my first post here and before I explain the problem I am facing, I just would like to thank you all for this forum and the tons of information and knowledge you share.I am a total newbie, except for many simple and strictly digital atmega and esp8266 projects, but this time I am designing a circuit that goes a little bit further by involving an ADC (AD7706) among other things. Globally it works fine, except for the SPI communications with (for now) an Arduino Uno. I have played a lot with SPI without issues, but here I am stuck and I guess it is because of some basic electronics thing that I dont know yet.The arduino is connected to the AD7706 with wires that are 3 inches long max, and the ADC is on a breadboard with its vital components. In short, I have trouble getting correct data or even worse, any data at all. I spent a considerable amount of time investigating the code (writing software is what I do professionally) and it all looks good. But now comes the interesting part: I hooked up a cheap logic analyzer and..bingo, it works. The logic analyzer shows data, and the arduino processes it correctly! In other works, it only works when the LA is connected to the breadboard. The same thing happens when the 4 probes of an oscilloscope are connected to the SPI pins...Does that kind of behavior ring any bell? What am I missing here?Thanks in advance for your help!

author: Cupcakus
author_rank: Contributor
timestamp: March 14, 2017, 06:08:05 am
content: Sounds like a common ground issue? Do both the ADC and arduino share the same ground? They should. Once you connect your logic analyzer to the circuit you are likely mains earth ground referencing everything and it starts to work. Dave posted a video of this very thing if I recall.Otherwise, It could be the added impedance from the logic analyser is preventing signal reflections at the Arduino, try adding some resistors to MOSI and MISO and see if things improve.

author: Martin7850
author_rank: Newbie
timestamp: March 14, 2017, 10:52:28 am
content: The ground should be common as there is a direct ground to ground wire between the arduino and the breadboard. Also, the arduino is USB powered from an earthed computer, and the breadboard power supply is also earthed.Thanks for the resistors suggestion, I'll try that tonight. From what I've read elsewhere, I could try a 50 ohms resistor in series on the source side, correct?

author: Psi
author_rank: Super Contributor
timestamp: March 14, 2017, 11:02:54 am
content: Double check ground is actually connected. Don't trust a breadboard to connect reliably.Also try and confirm exactly what from the LA needs to be connected before the circuit works.Is it just LA gnd or just LA signal or both?

author: Martin7850
author_rank: Newbie
timestamp: March 14, 2017, 09:46:58 pm
content: I double checked ground and it's good. To be even more sure, I added an extra ground connection from the Arduino to the breadboard, to no avail.I then connected only one LA input and gnd. It works when the input is connected to either MISO, MOSI or CLK.I then removed the LA and put a resistor in series on MISO and I do get data reliably... I guess I'll now do the same on MOSI and CLK as well.Interesting. First time I need to do that. I also suspect this breadboard to be of rather bad quality.