Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unusual SPI behaviour in Mode 1 #50

Open
aronfeher opened this issue Sep 8, 2020 · 0 comments
Open

Unusual SPI behaviour in Mode 1 #50

aronfeher opened this issue Sep 8, 2020 · 0 comments

Comments

@aronfeher
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant