Skip to content

Unusual SPI behaviour in Mode 1 #50

@aronfeher

Description

@aronfeher

Hello!
I have a Bpi zero with the latest kernel, and I'm trying to set and get data from ADS1294 IC through SPI communication. The IC expects SPI in mode 1. When I set the spidev0.0 to mode1 and start the data transfer, only junk came back, so I took out the logic analyzer and here is the interesting part.

If I set mode1 the clk line has an initial anomaly (first figure) which may confuse the ADS1294. At least the logic analyzer software was confused. If I set mode3 everything works as expected (second figure). Just for my sanity’s sake I’ve took out an Arduino nano, and started an SPI communication in mode1 (third figure). The waveform behaved as expected, and I could communicate with the ADS1294.

I have a feeling that some register is messed up, because this is my first time working with SPI in embedded OS, but I can’t figure out how to get rid of the problem.

I've tried this in both Python (py-spidev) and C, with the same result.

Any help would be appreciated.

mode1_bpi
mode3_bpi
mode1_arduino

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions