I2C PINOUT QUESTION



  • Hi,

    I'm possibly being a bit dense but I have a WiPy 2.0 plugged into an expansion board and I can't figure out where to connect SCA and SCL.

    The pin-outs for the WiPy 2.0 indecate that SCA/SCL are on P9 and P10.

    But the pin-outs for the expansion board indecate that P9 and P10 are used for the button and the LED.

    They can't both be right can they? Or does this mean I can't use the I2C bus?

    From this post I can see how to change the pins used for SCA and SCL but don't understand the mapping from the WiPy pinout to the expansion board pinout. Which pin is P7 on the expansion board?

    Thanks



  • @jmarcelino Thanks - that worked a treat (pull ups on P9/10 seem to be enabled by default which made life easier)



  • @mike632t What you see is just the effect that the ports are floating. Add pull-up resistors, and you should get an empty list.



  • Hmmm - With nothing connected I'd not expect to see any I2C devices but I get the following

    from machine import I2C
    i2c = I2C(0, I2C.MASTER, baudrate=100000, pins=("P19","P20"))
    i2c.scan()
    [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119]
    

    Don't think this is right...



  • @mike632t
    as @jmarcelino say you can change it e.g.

    i2c= I2C(0, I2C.MASTER, baudrate=100000, pins=("P19", "P20"))
    


  • Yes you can change the pins used by I2C.

    From that post P7 is G14, the pins are in the same order on both boards, they're a direct match - P13 is G5, P14 is G4, P6 is G13, etc.

    Alternatively you can also remove the jumper labelled "LED" which removes it from the circuit. The button has no effect as long as you don't press it.


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.