Jump to content

ArcticSaturn

Members
  • Content Count

    2
  • Joined

  • Last visited


Reputation Activity

  1. Like
    ArcticSaturn got a reaction from zeke in [Energia Library] Software I2C Master for MSP430G2553   
    @@zeke
     
    yes it does. I just read the spec from Sensirion and they say1000,000 + R/W bit. In my working code I always started with 0x80 so my assumption was address is 0x80 (which is wrong).
     
    Thanks for pointing me to it!
     
    Have a nice weekend!
  2. Like
    ArcticSaturn reacted to zeke in [Energia Library] Software I2C Master for MSP430G2553   
    @ArcticSaturn: 
     
    The first byte transmitted out on the I2C bus is a composition of the slave address and the read/write bit.
     
    Since the read/write bit occupies the least significant bit position in this first byte, the address appears to be incorrect but it's okay.
     
    For example, if the slave address = 0x04 and the R/W bit = 0 (write command) then the first byte looks like 0x08.
     
    Here's a C code snippet to elaborate:
    ... /************************************************************************** * Start reading sensor by sending the START condition **************************************************************************/ i2c_start(); /************************************************************************** * Then write out the sensor I2C address + the Read Bit * ( I2C Address << 1)|READBIT * ( (0x28<<1) | 0x01 ) = 0x51 **************************************************************************/ i2c_out_byte( ( SLAVE_ADDRESS<<1 ) | READBIT ); /************************************************************************** * Now see if the sensor responded to the command by checking * the ACK bit. **************************************************************************/ AckBit = i2c_readackbit(); ... Does that make sense?
    Is that what you are seeing?
     
     
×
×
  • Create New...