Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing the MPR121 I2C Touch Sensor with Prop — Parallax Forums

Interfacing the MPR121 I2C Touch Sensor with Prop

Michael @ AfineolMichael @ Afineol Posts: 33
edited 2015-02-24 19:54 in Propeller 1
I cannot get the Prop to recognize the MPR121 I2C. I have downloaded the: I2C SPIN Object from Dave Custer Jan 2008 Version 2.0

Multiple attempts to communicate with this device using the : PUB devicePresent(deviceAddress) : ackbit , have ended in utter frustration. Anyone make this work? Any help would be appreciated.

Mike

Comments

  • ChrisGaddChrisGadd Posts: 310
    edited 2015-02-24 13:17
    It looks pretty standard on the datasheet, only oddity is that the address pin may be connected to Vss, Vdd, Sda, or Scl for 7-bit device IDs of $5A through $5D.
    Most I2C problems seem to be related to using an incorrect address, using a 7-bit address when the object expects 8-bit or vice versa, or issues with pull up resistors or a lack thereof.

    Included in my I2C objects archive in the obex is an I2C poller that'll list the 7-bit address of all devices on the bus.

    Chris
  • T ChapT Chap Posts: 4,223
    edited 2015-02-24 16:00
    Can you post your code. 7 bit address should likely be bitshifted left by 1.
  • Michael @ AfineolMichael @ Afineol Posts: 33
    edited 2015-02-24 19:54
    Chris, I just used your code and everything worked like a charm. I was able to detect a touch on electrode 0! Thank you, you saved me hours of head scratching.
Sign In or Register to comment.