BiNa2605
Full Member level 3
Hi everyone,
I got troubles in programming I2C between PIC16F1513 and CCS811 gas sensor. I can detect the sensor (read hardware id of that sensor 0x81). When I read values in the Status register of that sensor, I receive a bit on ERROR notification, but when I checked value from ERROR register, it showed nothing. I don't know the reason. Maybe I have a problem in configuration, does anyone help me out? Thank you so much.
These codes that I used to check the sensor and read values from Status Register (0x00). I choose Mode 1 in operation, reading sensing signal every second.
This is the I2C signal
I got troubles in programming I2C between PIC16F1513 and CCS811 gas sensor. I can detect the sensor (read hardware id of that sensor 0x81). When I read values in the Status register of that sensor, I receive a bit on ERROR notification, but when I checked value from ERROR register, it showed nothing. I don't know the reason. Maybe I have a problem in configuration, does anyone help me out? Thank you so much.
These codes that I used to check the sensor and read values from Status Register (0x00). I choose Mode 1 in operation, reading sensing signal every second.
Code:
cID = CCS_Detect(0x20);
if(cID == 0x81)
{
CCS_Init(0xF4);
cStatus = CCS_Detect(0x00);
CCS_Configure();
cStatus = CCS_Detect(0x00);
if((cStatus & 0x05)){
Led_Blink_Signal();
}
else PORTB.B4 = 0;
}
This is the I2C signal
Attachments
Last edited: