Help needed with Adc ADS1118 - Page 1
Forum section: electronics / projects

author: steve41993
author_rank: Newbie
timestamp: April 09, 2021, 05:39:18 pm
content: I try to get the ADS1118 running properly but can't get it right.The adc is running in single shot, the sample rate is set to 16 samples per second and there is no filter on the inputs. The input voltage for this measurement is generated by a battery with a potentiometer.This is what I've got:What you can see is that the values are stable at 671 for most of the time. But some times it jumps to 702. It's jumping only between this two values and I have no clue why this happens.What I thought about:Noise on the input: not very likely because the values should be more randomNoise on the supply voltage / voltage reference: not very likely because the values should be more randomTransmission errors: not very likely because the values should be more randomSo everything which comes to my mind is unlikely because it's jumping exactly between two values.Another interesting point is that this happens only on some voltage levels. If I measure around e.g. 1167 "ticks" than there is not a single jump at all.I never had this behavior on any other adc before. Does someone had a similar problem or a solution / explanation for this? I'm completely lost here.

author: erikj
author_rank: Contributor
timestamp: April 10, 2021, 04:08:13 pm
content: My guess: communication issues with the ADCI have no experience with this particular ADC, but just looking at the two values 671 and 702 in binary I get:001010011111 (671)001010111110 (702)The only difference really is a missing zero.Noisy clock signal or timing issues perhaps?

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 10, 2021, 05:09:56 pm
content: And, if it is indeed a communication error, it may just come from using the wrong SPI mode. Which is a very common issue.As to noise, I take it you don't have a scope. That would be handy.

author: RoGeorge
author_rank: Super Contributor
timestamp: April 10, 2021, 05:33:49 pm
content: I've had similar issues with ADS1118, especially when used at 5V. At 3.3V it was happening much rare, or not at all.They are transmission error. To be more precise, my conclusion was those were reflections in the wires, wires that act like transmission lines with unmatched impedances at their ends. My guess was at 5V the chip was even faster, so any reflections were even more perturbing.Ideally the impedance between the transmitter, the wire and the receiver should be adapted so they match, but in practice that might be not possible (at any impedance mismatch a signal is reflected back to where it came from, with the same or opposite sign - depending of the two impedances ratio - therefore after one or many reflections the voltage waveform of a signal is altered enough that the receiver sees a different bit than it was transmitted <- if this doesn't make any sense, read aboutreflections in a transmission line).As a workaround, try adding some 10...1000 ohm resistors in series with the digital wires (at the transmitting side of each wire), and see if the communication improves. Shorter wires might help, too.

author: steve41993
author_rank: Newbie
timestamp: April 10, 2021, 05:44:32 pm
content: Thanks for your suggestions.I will do the measurements tomorrow and post them here. Also I will have a look into the SPI configuration and double check.@RoGeorgeThanks for sharing. I will give this a try as well.

author: SuzyC
author_rank: Frequent Contributor
timestamp: April 10, 2021, 09:43:15 pm
content: Could just be a bad spot on the pot, check the pot output voltage with a DVM.

author: bson
author_rank: Unknown
timestamp: April 10, 2021, 11:13:46 pm
content: I've extensively used the I2C version, with none of that behavior - so I agree it's almost certainly the SPI end of things.

author: nctnico
author_rank: Super Contributor
timestamp: April 11, 2021, 01:07:23 am
content: First thing to do is get a scope and check the clock edges versus the data and then check the datasheet when the data is sampled by the microcontroller.

author: steve41993
author_rank: Newbie
timestamp: April 11, 2021, 03:08:02 pm
content: Measurements are done. But i thinks this doesn't reveal anything.SPI communication looks fine. The MISO line is set on the rising edge of the CLK and the MCU samples it on the falling edge.In this case the values are toggling between 689 and 657 / 658. This is perfectly fine on the SPI.689: SDS00001.png657: SDS00002.pngI think there is no issue on the SPI communication part and it's directly related to the ADC itself.During writing this I decided to change the ADC. And it seems that this fixed the issue and the part was damaged in some way.So thanks for all your help