I have an issue when communicating with an ADC over SPI. If I imitate the SPI protocol via bitbanging then I have no issues with communication; however, if I use the SPI hardware (I've tried Arduino and mbedOS) then communication fails and no data is received.
The biggest discernible differences are:
- The idle state of the MOSI line. When bitbanging, this line is held low when idle as opposed to high when idle using SPI.
- When bitbanging, the MISO line goes high as soon as CS does. When using SPI however, there is a noticeable slew.
- Lastly, CS takes a relatively long time to go high after the final clock pulse when using SPI as opposed to nearly immediately when bitbanging.
- The time taken to send the messages (visible in the images below). Though I can't imagine that this is an issue.
I am running in SPI mode 0, as according to the ADC datasheet. I've tried an Arduino Uno and a RedBearLabs Blend V2 (running mbedOS).
Below are two scope grabs of the signals.
- Trace 1 is SCLK.
- Trace 2 is CS.
- Trace 3 is MOSI.
- Trace 4 is MISO.
I am sending
10000000 on MOSI. The response received is not included in the scope grabs as I believe the issue is with the command sent in the grabs.