This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I2C si7055

I have an si7055 i2c temperature sensor connected to an nRF52840

I've tried my best to get a reading, but failed.

Therefore given up.

I'd be grateful for some help to determine what I've done wrong please.

I've included the project in zipped form for board nrf52840dk.nrf52840

Bluetooth-i2c.zip

Parents
  • Unfortunately I do not have a logic analyzer.

    I am running the code on SDK v1.4.2

    I modified si7055.c which is why i2c master found is displayed in the following output. However I receive the same message if I change the address of the sensor in the overlay. I have checked that the correct address is recorded in zephyr.dts 

    I'd be grateful if you would check that the overlay included in the project is correctly recording:

    SDA 24

    SCL 25

    si7055 address 0x40

    Therefore I'm expecting that regardless of what the logic analyzer is showing you that the call to si7055_init will confirm that the sensor is present.

    static int si7055_init(const struct device *dev)

    {
    struct si7055_data *drv_data = dev->data;

    drv_data->i2c_dev = device_get_binding(
    DT_INST_BUS_LABEL(0));

    if (!drv_data->i2c_dev) {
    LOG_ERR("i2c master not found.");
    return -EINVAL;
    } else {
    printk("i2c master found\n");
    }

    LOG_DBG("si7055 init ok");

    return 0;
    }

    i2c master found
    *** Booting Zephyr OS build v2.4.0-ncs2 ***
    [00:00:03.000,396] [1;31m<err> i2c_nrfx_twim: Error 195952641 occurred for message 0[0m
    [00:00:03.000,427] [1;31m<err> si7055: read register err[0m
    sample fetch error
    [00:00:06.000,671] [1;31m<err> i2c_nrfx_twim: Error 195952641 occurred for message 0[0m
    [00:00:06.000,671] [1;31m<err> si7055: read register err[0m
    [

    There seem to be a few issues with the sensor.h implementation as indicated in the following 2 links:

    https://devzone.nordicsemi.com/f/nordic-q-a/70514/i2c_burst_read-and-i2c_burst_write-not-working-on-nrf5340

    https://devzone.nordicsemi.com/f/nordic-q-a/69828/i2c_burst_write-difference-nrf52-and-nrf91-series/290657#290657

Reply
  • Unfortunately I do not have a logic analyzer.

    I am running the code on SDK v1.4.2

    I modified si7055.c which is why i2c master found is displayed in the following output. However I receive the same message if I change the address of the sensor in the overlay. I have checked that the correct address is recorded in zephyr.dts 

    I'd be grateful if you would check that the overlay included in the project is correctly recording:

    SDA 24

    SCL 25

    si7055 address 0x40

    Therefore I'm expecting that regardless of what the logic analyzer is showing you that the call to si7055_init will confirm that the sensor is present.

    static int si7055_init(const struct device *dev)

    {
    struct si7055_data *drv_data = dev->data;

    drv_data->i2c_dev = device_get_binding(
    DT_INST_BUS_LABEL(0));

    if (!drv_data->i2c_dev) {
    LOG_ERR("i2c master not found.");
    return -EINVAL;
    } else {
    printk("i2c master found\n");
    }

    LOG_DBG("si7055 init ok");

    return 0;
    }

    i2c master found
    *** Booting Zephyr OS build v2.4.0-ncs2 ***
    [00:00:03.000,396] [1;31m<err> i2c_nrfx_twim: Error 195952641 occurred for message 0[0m
    [00:00:03.000,427] [1;31m<err> si7055: read register err[0m
    sample fetch error
    [00:00:06.000,671] [1;31m<err> i2c_nrfx_twim: Error 195952641 occurred for message 0[0m
    [00:00:06.000,671] [1;31m<err> si7055: read register err[0m
    [

    There seem to be a few issues with the sensor.h implementation as indicated in the following 2 links:

    https://devzone.nordicsemi.com/f/nordic-q-a/70514/i2c_burst_read-and-i2c_burst_write-not-working-on-nrf5340

    https://devzone.nordicsemi.com/f/nordic-q-a/69828/i2c_burst_write-difference-nrf52-and-nrf91-series/290657#290657

Children
No Data
Related