DarqueChaton
New Member
Hello all! Please forgive me if this is in the wrong category, I am new here !
So I have a Si7005 sensor from Silicon Labs which is a humidity and temperature sensor that communicates with an I2C interface. I've been trying to at the very least retrieve the device ID from the register specified in the datasheet with little to no result.
When I attempt to retrieve the device ID, I get 255 value, which is not what is specified in the datasheet at all (I should be getting 80)
Here is a sample of the C code I wrote for it , I am attempting to get the value and printing it out on an NHD LCD I have setup . I am us CCS C Compiler and MPLAB X :
#include "projet.h"
#include "ecran.h"
void main (void)
{
int8_t devid=24;
Initialiser_Ecran(); // LCD initialisation
Effacer_Ecran(); // Erase LCD
while(1)
{
i2c_start();
i2c_write(0x40); // Slave adress
i2c_write(0x11); // Device ID Register
i2c_start();
i2c_write(0x41); // R/W bit set to READ
devid = i2c_read(1); // No ACK
i2c_stop();
Positionner_Curseur(1,1); // Place cursor
fprintf(Ecran, "Device ID = %U",devid); // Print
}
Here is a link to the datasheet of my sensor : **broken link removed**
Any help I can get is appreciated =) Thank you!
So I have a Si7005 sensor from Silicon Labs which is a humidity and temperature sensor that communicates with an I2C interface. I've been trying to at the very least retrieve the device ID from the register specified in the datasheet with little to no result.
When I attempt to retrieve the device ID, I get 255 value, which is not what is specified in the datasheet at all (I should be getting 80)
Here is a sample of the C code I wrote for it , I am attempting to get the value and printing it out on an NHD LCD I have setup . I am us CCS C Compiler and MPLAB X :
#include "projet.h"
#include "ecran.h"
void main (void)
{
int8_t devid=24;
Initialiser_Ecran(); // LCD initialisation
Effacer_Ecran(); // Erase LCD
while(1)
{
i2c_start();
i2c_write(0x40); // Slave adress
i2c_write(0x11); // Device ID Register
i2c_start();
i2c_write(0x41); // R/W bit set to READ
devid = i2c_read(1); // No ACK
i2c_stop();
Positionner_Curseur(1,1); // Place cursor
fprintf(Ecran, "Device ID = %U",devid); // Print
}
Here is a link to the datasheet of my sensor : **broken link removed**
Any help I can get is appreciated =) Thank you!