none
problems detecting I2c device RRS feed

  • Question

  • Hello,
    I'm trying to use a cheapo 16x2 LCD that comes with a I2c Interface. My first problem is discover the I2c address my device is

    I found this script

    http://playground.arduino.cc/Main/I2cScanner

    but I´m not able to successfully run it :( , not even know how to wire it  - galileo dedicated SDA/SDL pins or 4/5 as other arduino boards?)

    noob questions, I know, but I'm quite new on this.

    Thanks


    • Edited by Bingen O Thursday, February 19, 2015 6:20 PM
    Thursday, February 19, 2015 5:19 PM

Answers

  • Bingen,

    Typically the I2C address is found by looking at the schematic and/or the datasheet for the actual I2C chip on the board. It may also be found in sample code for the board, and it may be printed on the board itself.

    If necessary, you could write and run a sketch that tried to write a zero to each legal I2C address and reported which addresses did not generate an error. The Galileo Gen1 has a device at I2C address 0x20 (if the I2C address jumper is in its default location), and the Gen2 has devices at addresses 0x25, 0x26, 0x27 and 0x47.  If any other address responds it is your board.

    Pins SDA/SCL are tied directly to pins A4/A5 on the Galileo board, they are not really dedicated to I2C.  It does not make any difference which set of pins you use.

    Bert.

    Thursday, February 19, 2015 8:53 PM

All replies

  • Hi Bingen,

    Just in case you didn't see it, there is a sample for a 2x16 LCD at http://ms-iot.github.io/content/16x2LCD.htm but it is not using SDA/SDL. Also, there is an I2C sample that uses a port extender at http://ms-iot.github.io/content/MCP23017Sample.htm.

    Can you provide a link to the LCD you bought?  Would it wire up like the MCP23017Sample?

    Is the script working without the LCD connected?

    Sincerely, IoTGirl

    Thursday, February 19, 2015 7:44 PM
    Moderator
  • Bingen,

    Typically the I2C address is found by looking at the schematic and/or the datasheet for the actual I2C chip on the board. It may also be found in sample code for the board, and it may be printed on the board itself.

    If necessary, you could write and run a sketch that tried to write a zero to each legal I2C address and reported which addresses did not generate an error. The Galileo Gen1 has a device at I2C address 0x20 (if the I2C address jumper is in its default location), and the Gen2 has devices at addresses 0x25, 0x26, 0x27 and 0x47.  If any other address responds it is your board.

    Pins SDA/SCL are tied directly to pins A4/A5 on the Galileo board, they are not really dedicated to I2C.  It does not make any difference which set of pins you use.

    Bert.

    Thursday, February 19, 2015 8:53 PM
  • being a cheap LCD implies no data sheet :(  I finally managed to detect the port rebooting without windows and running the script from arduino IDE.

    Now trying to write something on screen:P

    Friday, February 20, 2015 7:13 AM
  • The http://playground.arduino.cc/Main/I2cScanner script tries every I2C address from 1-127 (0x01-0x7F).  This does not conform to the I2C specifications.

    Addresses in the range of 0x00-0x07 and 0x78-0x7F are reserved for special uses, and they should not be used indiscriminately because they may cause undesirable states in attached chips.  For more information, see http://www.nxp.com/documents/user_manual/UM10204.pdf section 3.1.12 "Reserved addresses."

    The Windows based I2C code verifies that a requested address is not in the reserved range before using it.  I suspect this is why the script will not run.

    Bert.

    Tuesday, February 24, 2015 9:07 PM