What would cause an I2C scan to show all addresses being active when there should be no for this to happen? That is what happens when I run my simple I2C bus scanner script on a Teensy 4.0. I have never seen this before.
8-Dale
Code:
# Import all board pins.
from machine import SoftI2C, Pin
from micropython import const
HW_I2C0_SDA = const(18)
HW_I2C0_SCL = const(19)
HW_I2C1_SDA = const(17)
HW_I2C1_SCL = const(16)
TP_SDA = Pin(HW_I2C0_SDA)
TP_SCL = Pin(HW_I2C0_SCL)
# Create the I2C interface.
i2c = SoftI2C(sda=TP_SDA, scl=TP_SCL, freq=400000)
print()
print("Simple I2C bus scanner")
print()
scan = i2c.scan()
if scan:
print("Devices on the I2C bus:")
for addr in scan:
print("\tDecimal: {0:3d}, Hex: {1}".format(addr, hex(addr)))
else:
print("There are no devices on the I2C bus")
print()
8-Dale
Last edited: