Not find any i2c devices with Fipy Pytrack



  • Hi, I'm trying to connect an mpu-9250/6500 in External IO Header to SDA = P10 and SCL= P9. When I do i2c.scan() I obtain an empty list [].

    I try to do the scan because I get I2C BUS ERROR everytime I implemented a code who uses the MPU9250.

    When I Scan the pytrack port P22 and P21 return me the list [8, 16, 30] that I assume that is GPS and Accelometer from pytrack, so I don't think my I2c is bad.

    with this code I'm read

    import time
    
    from machine import I2C, Pin
    from mpu9250 import MPU9250
    
    print(os.uname())
    
    #SDA SCL
    i2c = I2C(0, I2C.MASTER, pins=('P10','P9'), baudrate=400000)
    
    while True:
        devices = i2c.scan()
        print(devices)
        time.sleep(1)
    
    

    I tested with a multimeter the pins P10 and P9 pins from External I/O and I have 0 volt.

    Also tried with a multimeter the pins P2 and P5 and I have 3 Volts in both, when I scan those pins connected to my MPU I get an empty list.

    In addition I try to use only the FiPy alone conecting to Rx, Tx, 5V and Gnd and connect my MPU9250 to pins P22 and P21 and not found, only return [].

    Also I try with other MPU-9250 and not work.

    What's wrong? I would appreciate it very much if someone try to help.



  • @Paula-Mancilla That indicates that the signal levels on SDA and SCL are not stable. Please check again the wiring and the pull-up resistors. Appropriate values are 10k - 1k Ohm.



  • @robert-hh Thank you for you response, I managed to scan my MPU-9250, but i2c.scan return more than ones devices. And this device changes through time.

    32a9651b-2b82-470f-b3e2-73a6a8aee6a1-imagen.png

    I only have conected MPU-9250. I try to read the values from MPU-9250 and I get an i2C BUS ERROR. Any idea?

    Greetings



  • @Paula-Mancilla When you read 0 v it may have the reason that the pull-up resistors are missing, and you have to add them yourself. Some of the breakouts with sensors have these on the PCB, some not.


Log in to reply
 

Pycom on Twitter