Check Wiring.. ESP32 with BMP280 on SPI

hallo,
ich habe meinen BMP280 an den ESP32 gelötet:

SCL = SCK = IO18
SDA = MOSI = IO23
CS = IO33
SD0 = MISO = IO19

Ich verwende SPI wie man sieht.

Az-Delevery ESP32-WROOM-32

ich habe mit dem Multimeter alle Pins und Verbindungen überprüft. Alles sollte richtig verbunden sein.

Als Output bekomme ich nur die Fehlermeldung.

'''
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_BMP280.h>

//Adafruit_BMP280 bmp; // I2C
Adafruit_BMP280 bmp(33); // hardware SPI
//Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);

void setup() {
Serial.begin(9600);

Serial.println(F("BMP280 test"));

//if (!bmp.begin(BMP280_ADDRESS_ALT, BMP280_CHIPID)) {
if (!bmp.begin()) {
Serial.println(F("Could not find a valid BMP280 sensor, check wiring or "
"try a different address!"));
while (1) delay(10);
}

/* Default settings from datasheet. /
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /
Operating Mode. /
Adafruit_BMP280::SAMPLING_X2, /
Temp. oversampling /
Adafruit_BMP280::SAMPLING_X16, /
Pressure oversampling /
Adafruit_BMP280::FILTER_X16, /
Filtering. /
Adafruit_BMP280::STANDBY_MS_500); /
Standby time. */
}

void loop() {
Serial.print(F("Temperature = "));
Serial.print(bmp.readTemperature());
Serial.println(" *C");

Serial.print(F("Pressure = "));
Serial.print(bmp.readPressure());
Serial.println(" Pa");

Serial.print(F("Approx altitude = "));
Serial.print(bmp.readAltitude(1013.25)); /* Adjusted to local forecast! */
Serial.println(" m");

Serial.println();
delay(2000);

}
'''

The ESP32 has 2 ports.

portA and portB.

portA covers GPIO_NUM_0 to GPIO_NUM_32.

portB covers GPIO_NUM_33+

portB is for input only. CS is an output, which does not work on portB. Use a GPIO_NUM_X from portA..

ok, but it was working when i had it on my breadboard.
Now it doesnt work anymore..
I thought about a Software problem :slight_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.