-
Notifications
You must be signed in to change notification settings - Fork 25
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
I2C works, but SPI fails due to wrong chip id #43
Comments
@iyanmv I believe the forum post is essentially saying to try something like this:
Or maybe try different permutations of 1 and 0 for the values of those, the default values are both 0, so try the other 3 permutations and see if any of them work for you. |
I tested the BMP280 sensor over SPI on a Raspberry Pi 4 with current versions of Blinka and the BMP280 driver and found it was successfully initializing and taking readings. I did not need ot use the polarity or phase arguments, I used a mostly stock simpletest script from this repo with the only changes being to uncomment the SPI sections of code and to change the CS pin to D5 instead of D10. @iyanmv Upon taking a closer look at your image, I think that latter change of the pin from D5 to D10 might be the crux of your issue. In the code you posted it's using D10 for the CS pin: But in the photo it appears that your CS pin is connected to pin D5 on the Raspberry pi (https://www.raspberrypi.com/documentation/computers/images/GPIO-Pinout-Diagram-2.png?hash=df7d7847c57a1ca6d5b2617695de6d46) D5 is the 3rd pin away from the SCK pin. Were you following along with this learn guide page? https://learn.adafruit.com/adafruit-bmp280-barometric-pressure-plus-temperature-sensor-breakout/circuitpython-test#python-computer-wiring-2997144 I did notice that the wiring diagram on that page shows the connection to D5 which looks to match your wiring. And some of the code sections on that page do refer to pin D5. But the final code section which shows the complete example is using pin D10 which would require different wiring from what is shown above. I will open a PR to change the pin in the example code to D5 so it matches the image and the other code snippets in the guide. |
Hello,
I just received a Adafruit BMP280 and I can't make the SPI example work. This is the error I get:
I2C works just as described in the example and in the tutorial.
I was first using a Raspberry Pi 5, but because I read other people having issues with the latest RPi, I also tried on a RPi 3B with the same outcome. I was also using a GPIO Extension Board, but just in case I also tried connecting the cables directly, but it doesn't make a difference.
This is the exact example I'm trying to run:
And here is a photo of the setup:
Probably related to this I found this closed issue (#27) and this closed thread in the forum.
Any ideas what might I be doing wrong? Or how to debug further? I have no prior experience with SPI.
The text was updated successfully, but these errors were encountered: