I'm trying to get read data off and an LTC1867 ADC chip. My previous questions are based around this for more info

My values were consistently wrong. I think my code works correctly. I have tried both using pigpio and spidev and both give the same wrong results.

I used piscope on two different raspberry pis to make sure the problem wasn't from my pins. The results are shown below. This is different from what I would expect from the datasheet as the pulses aren't even. but there are 16 pulses nonetheless. enter image description here enter image description here

My main questions are:

  • Does anyone have any idea why my waveforms are coming out like that/how to fix it
  • Why do I get random values?
  • Would bitbanging/software SPI solve the issue?
  • 2
    \$\begingroup\$ Your "scope" is zoomed waaay too far out on the time scale. Those SPI signals are in the 10's of kHz to MHz range (so things are happening on the micro-second scale) and you're looking at whole seconds on your scope. You'll see a lot more detail if you zoom in on those "spikes". \$\endgroup\$
    – brhans
    Feb 9, 2017 at 20:01
  • 1
    \$\begingroup\$ The SPI signals are too fast for whatever piscope is using for a sampling rate. Each of those spikes should be made of a lot of very short pulses. You need a much higher sampling rate to see the SPI signals. \$\endgroup\$
    – JRE
    Feb 9, 2017 at 20:06
  • \$\begingroup\$ @brhans thanks for that! Would have completely missed it. The clock still seems to be missing some pulses. Any idea why? \$\endgroup\$
    – Baba
    Feb 9, 2017 at 23:41
  • \$\begingroup\$ @JRE Just updated with new images, the clock seems to be missing some pulses \$\endgroup\$
    – Baba
    Feb 9, 2017 at 23:43
  • 2
    \$\begingroup\$ The images look like they were sampled at 5us and not fast enough to show a true picture of the signals. I looked up piscope, it seems to be based on the gpio pins of the R.Pi. It is not going to be fast enough for the current SPI data rate. If you really want that to show the SPI signals in recognizable form, you can try setting the SPI data rate much lower, perhaps 10 or 20Kbps. \$\endgroup\$
    – rioraxe
    Feb 10, 2017 at 3:17


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.