When I've had problems similar to those you described when interfacing
SPI devices to a microcontroller, it was usually caused by some
violation of the timing diagram. I was writing my own SPI
communications routines in assembler on a PIC microcontroller. I did a
quick search and it looks like that part is being done for you with the
Arduino.
https://www.arduino.cc/en/Reference/SPI
That is a very well written article. It might be a good idea to read
through it as a troubleshooting guide to see if any of the issues it
mentions might be causing you problems.
I'd still get a digital storage oscilloscope and capture the signals to
see what might be causing the problem. Seeing the signals is the best
and quickest way to verify a lot of things, many of which you might not
even imagine would be a problem - voltage levels, noise, ground bounce,
timing issues, etc. Make sure the signals match the signals shown in
the ADS1256 data sheet.
This is the sort of thing that can eat your lunch (from the link
provided above):
The SPI standard is loose and each device implements it a little
differently. This means you have to pay special attention to the
device's datasheet when writing your code.
Generally speaking, there are four modes of transmission. These modes
control whether data is shifted in and out on the rising or falling edge
of the data clock signal (called the clock *phase*), and whether the
clock is idle when high or low (called the clock *polarity*). The four
modes combine polarity and phase according to this table:
*Mode* *Clock Polarity (CPOL)* *Clock Phase (CPHA)* *Output Edge*
*Data Capture*
SPI_MODE0 0 0 Falling Rising
SPI_MODE1 0 1 Rising Falling
SPI_MODE2 1 0 Rising Falling
SPI_MODE3 1 1 Falling Rising
On 12/17/18 9:38 AM, andy pugh wrote:
On Mon, 17 Dec 2018 at 14:18, Charles Steinkuehler
<char...@steinkuehler.net> wrote:
Double-check your wiring and the data sheets, paying particular
attention to the direction of the data signals. I have found the data
line labeling (MISO/MOSI, DIn/DOut, etc) to be somewhat haphazardly
applied, and your symptoms would be explained by having the data lines
swapped (so two drivers bus-fighting on one line, and the other line
floating).
I have buzzed this through from the Arduino to the pins on the actual
ADS1256 chip, and that all seems correct.
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users