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

INVERT the sense of the I2C_POWER pin (active low) #5595

Merged
merged 1 commit into from
Nov 17, 2021
Merged

Conversation

anecdata
Copy link
Member

I don't have the board to test, but this was reported and discussed on Discord. Probably only relevant for the BME280 version of the board.

I don't have the board to test, but this was reported and discussed on Discord.
@jerryneedell
Copy link
Collaborator

From the schematic, VSENSOR also goes out to the STEMMA connector - so this may also impact the non BME280 version

@jerryneedell
Copy link
Collaborator

Unfortunately, today, I have been unable to get it to fail regardless of whether the I2C_POWER pin is set to True or False...

@jerryneedell
Copy link
Collaborator

this is the code I am using to test -- I just change the ip.value from False to True but today , it does not seem to care.

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import time
import board
from adafruit_bme280 import basic as adafruit_bme280
import digitalio

ip = digitalio.DigitalInOut(board.I2C_POWER)
ip.switch_to_output()
ip.value = False
# Create sensor object, using the board's default I2C bus.
i2c = board.I2C()  # uses board.SCL and board.SDA
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)

# OR create sensor object, using the board's default SPI bus.
# spi = board.SPI()
# bme_cs = digitalio.DigitalInOut(board.D10)
# bme280 = adafruit_bme280.Adafruit_BME280_SPI(spi, bme_cs)

# change this to match the location's pressure (hPa) at sea level
bme280.sea_level_pressure = 1013.25

while True:
    print("\nTemperature: %0.1f C" % bme280.temperature)
    print("Humidity: %0.1f %%" % bme280.relative_humidity)
    print("Pressure: %0.1f hPa" % bme280.pressure)
    print("Altitude = %0.2f meters" % bme280.altitude)
    time.sleep(2)

@anecdata
Copy link
Member Author

@jerryneedell Do you have a Rev.A board?

@jerryneedell
Copy link
Collaborator

How can I tel if it is Rev A?

@anecdata
Copy link
Member Author

On the silk, in theory

@jerryneedell
Copy link
Collaborator

I don't see any indication.

@anecdata
Copy link
Member Author

huh, maybe only gets the silk treatment when it changes to Rev.B

@jerryneedell
Copy link
Collaborator

The schematic I saw is Rev B -- what changed from Rev A?

@ladyada
Copy link
Member

ladyada commented Nov 16, 2021

rev A did not have power control

@jerryneedell
Copy link
Collaborator

How can I tell Rev A from Rev B board?

@jerryneedell
Copy link
Collaborator

jerryneedell commented Nov 16, 2021

I am looking at the V+ pin on the STEMMA connector with a scope. If I set I2C_POWER to False, it stays steady at 3.3V.
If I set it to True, then the voltage drops just below 3V and when the BME280 sensor is accessed, it drops briefly (10ms) to <1.5 V. Does this sound like Rev A or Rev B?

Note: the BME280 sensor is working with both settings of I2C_POWER -- I saw one failure when it was True, but cannot reproduce that.

@jerryneedell
Copy link
Collaborator

jerryneedell commented Nov 16, 2021

sorry -- the votls/div was set to 1.04 for these shots... but you get the point...

I2C_POWER = True
DS1Z_QuickPrint6

I2C_POWER=False
DS1Z_QuickPrint7

@ladyada
Copy link
Member

ladyada commented Nov 16, 2021

you're probably seeing parasitic power thru the I2C pins. you definteitely need to pull the power pin low to access i2c

@jerryneedell
Copy link
Collaborator

jerryneedell commented Nov 16, 2021

@ladyada should I assume I have a rev b board.? Is there a way to tell?

@ladyada
Copy link
Member

ladyada commented Nov 16, 2021

if you're not me or i think scott, you have only a rev B board. we never shipped rev A thru the shop :)

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is good!

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

Successfully merging this pull request may close these issues.

4 participants