Author Topic: I2C bus Smart Tile  (Read 11501 times)

jurg1505

  • Newbie
  • *
  • Posts: 10
  • I'm a llama!
    • View Profile
I2C bus Smart Tile
« on: June 29, 2015, 04:05:38 AM »
I am a noob in I2C bus
Can anyone explain how i can read the sensor with a Smart Tile ?
http://www.adafruit.com/products/1893


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:I2C bus Smart Tile
« Reply #1 on: June 30, 2015, 07:38:36 PM »
First you need to know the slave ID of the I2C slave.

Then from the data sheet, find out what addresses you need to write to the sensor (how many bytes) before you can read the data. Then use the I2C_WRITE command followed by I2C_READ command to get the data into the DM area.

I2C_WRITE command does not send a I2C_STOP bit automatically. So a I2C_READ followed by a I2C_WRITE will send a RESTART bit to the I2C slave and the slave will then start to output the data that the master wishes to read.

Attached is a sample program to write to the RTC chip internal RAM data area and then read back some data using the I2C commands.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS