I²C slave address

Hi, trying to read out the data from some pressure sensors. They are used as slaves an my arduino as master. My question is: How do i figure out the adresse of the sensors?

The datasheet says that the sensors have some preconfigured slave addresses.... Here the part from the datasheet:

Slave address: The I²C-bus master-slave concept requires a unique address for each device. The HCLA has a preconfigured slave address (1111000xb). By factory programming it is possible to define a secondary slave address additional to the general one. According to I²C specification 127 different addresses are available. The sensor will then listen to both slave addresses. After generating a START condition the master sends the address byte containing a 7 bit address followed by a data direction bit (R/W). A "0" indicates a transmission from master to slave (WRITE), a "1" indicates a data request (READ).

Do I need to read the address from (1111000xb) before I start the measurement? Or is the a nicer easier way faster way to handle that problem? Thanks a lot kohlmeise

Plug each sensor in on it’s own and use the general address (1111000xb) to set a unique (to each sensor) alternate address. Once they all have a unique address then plug them all in together and address them individually using the unique alternate address.

I also thaught about that ... but ... 1. how do i tell the device the new address ? 2. how does such a address look like ? 0x1111000b (preprogrammed)... 0x1111001b(alternate?!?)

http://www.sensortechnics.com/cms/upload/appnotes/AN_I2C-Bus_HMI_HDI_HCLA_HCA_SSI_E_11155.pdf

this is the datasheet for the I²C bus. Iam sorry but Iam totally overchallenged :roll_eyes:

Looking at the datasheet you linked to and the telling words are...

NOTE: The digital I²C bus pressure sensors of the HMI, HDI, HCLA, HCA and SSI series have a general preconfigured slave address (0x1111000b). By factory programming it is possible to define an additional secondary slave address for each individual device. According to I²C bus specification 127 different addresses are available. The sensor will then listen to both slave addresses.

What exact sensor do you have as the sheet you linked to does not list registers?

HCLA05

... But even the datasheet to this series doesn´t tell anything about registers .... so i thought this is some general problem ...

kohlmeise: HCLA05

... But even the datasheet to this series doesn´t tell anything about registers .... so i thought this is some general problem ...

I cannot find and information either so it looks like you can only get the manufacturer to change the address. Maybe if you ask they will let you know how to re-program the address.

Next question is how many of these sensors do you want to connect as you can always use an I2C multiplex chip. TI & NXP (to name but two) have 2x 4x & 8x channel chips.

In the end I want to use 8 in parrallel. But in the moment I would be happy for only one sensor ... :D real general .... do I use the adress like 1111000 or do I need to ad xb as well ? Also the datasheet changes the address .... 1111000xb / 0x1111000b Thin that is very general programming problem ?! ....

Thank you very much so far ! :)

8 can be done using a single multiplex chip.

Untested but I think the code to read will be something like…

#include <Wire.h>

void setup(){
  Wire.begin();               // join i2c bus (address optional for master)
  Serial.begin(9600);         // start serial for output
}

void loop(){
  //Wire.requestFrom(0xF1, 2);  // request 2 bytes from slave device 0xF1 (0x11110001b)
  Wire.requestFrom(0x79, 2);  // request 2 bytes from slave device 0x79 (0x01111001b)
  unsigned int c = 0;

  while(Wire.available()){    // slave may send less than requested
    byte x = Wire.read();     // receive a byte as character
    c = (c << 8) | x;         // Rotate into c
  }
  Serial.println(c);          // print the number

  delay(500);
}

I’m not sure about the address so I have commented out the 0xF1 version in favour of the 0x79 one.

Did you solve it?