Skip to content

Commit a6d271b

Browse files
authored
Merge pull request #132 from Pi4J/BME280_readmen
BME readme update
2 parents 737ce34 + e23dad5 commit a6d271b

1 file changed

Lines changed: 33 additions & 29 deletions

File tree

  • src/main/java/com/pi4j/devices/bme280

src/main/java/com/pi4j/devices/bme280/README.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,51 @@ https://pdf1.alldatasheet.com/datasheet-pdf/view/1132060/BOSCH/BME280.html
33
This example device has been migrated under the drivers. The device code can be found at
44
https://github.com/Pi4J/pi4j-drivers/tree/main/src/main/java/com/pi4j/drivers/sensor/bmx280
55

6-
The program uses org.slf4j.simple Class SimpleLogger as suggested by the Pi4j_V2 documentation.
7-
Consult that logger class documentation to understand its various logging options.
86

9-
I2C connection path.
7+
I2C
108

119
1. ./mvnw clean package
1210
2. cd target/distribution
1311
3. sudo ./runBME280I2C.sh
14-
Args if bus and or address must be set
15-
-b 0x01 -a 0x77
12+
Args if address must be set
13+
-a 0x77
1614

17-
The SPI example assumes SPI bus 0, ChipSelect GPIO 21. The GPIO is configurable as a program parm option.
15+
No parameters are required. However, if 'any' parameter value is to be supplied:
16+
parms: -a hex value address
17+
1818

19-
The SPI connection per the Datasheet supports MODE0 or MODE3. The spec shows reading a register consists of:
19+
SPI
20+
The SPI connection per the Datasheet supports MODE0 or MODE3.
21+
The SPI example assumes SPI bus 0, ChipSelect 0
2022

21-
1. Chip select driven low
22-
2. Eight clocks pulses to write the register address via the Pi MOSI
23-
3. Multiple eight clock pulses for each byte of data returned thru the Pi MISO
24-
4. Chip select driven high
23+
1. ./mvnw clean package
24+
2. cd target/distribution
25+
3. sudo ./runBME280SPI.sh
26+
4.
2527

26-
In either Mode0 or Mode3 the read data bytes are miss-read and the clock pulses are not signaled for the expected reads.
27-
The SPI open flags support configuration of writing a determined number of bytes before continuing the clock pulses
28-
for the expected read data . This however requires the BMP280 chip connect using the 3-wire configuration and
29-
the chips config register be modified. As most chips use 4-wire configuration I use 4-wire, and use a configurable
30-
GPIO as the CS (chip select)
3128

32-
SPI connection path.
29+
I2C connection
3330

34-
1. ./mvnw clean package
35-
2. cd target/distribution
36-
3. sudo ./runBME280SPI.sh -csp 21
31+
| RPi | Color | Sensor |
32+
|:-----------|:-------|:-------|
33+
| Pin1 3.3V | Red | Vin |
34+
| N/C | | 3v |
35+
| Pin6 Gnd | Brown | Gnd |
36+
| Pin5 SCL | Green | SCK |
37+
| N/C | Yellow | SDO |
38+
| Pin3 SDA | Blue | SDI |
39+
| Pin17 3.3v | Orange | CS |
3740

38-
No parameters are required. However, if 'any' parameter value is to be supplied:
39-
parms: -b hex value bus -a hex value address -t trace
40-
trace values : "trace", "debug", "info", "warn", "error" or "off" Default "info"
4141

4242
SPI connection using 4-wire SPI
4343

44-
Pi p19 MOSI BMP SDI Blue
45-
Pi p21 MISO BMP SDO Yellow
46-
Pi p23 SCLK BMP SCK Green
47-
Pi p40 GPIO21 BMP CS Orange
48-
Pi Gnd BMP GND Brown
49-
Pi 3.3 BMP Vin Red
44+
| RPi | Color | Sensor |
45+
|:-------------|:-------|:-------|
46+
| Pin19 MOSI | Blue | SDI |
47+
| Pin21 MISO | Yellow | SDO |
48+
| Pin23 SCLK | Green | SCK |
49+
| Pin24 SPICE0 | Orange | CS |
50+
| Pin6 Gnd | Brown | GND |
51+
| Pin1 3.3V | Red | Vin |
52+
53+

0 commit comments

Comments
 (0)