CS811 Data Read Issues

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
moh0058
 
Posts: 3
Joined: Wed May 11, 2022 2:28 pm

CS811 Data Read Issues

Post by moh0058 »

Hi All,

For my current Uni project, we are to build and use the CS811 TVOC sensor. As part of the requirement, we are to use STM32 F411RE with LL code ( to write our own libraries to read and write to the I2C device). I am having issues reading the data back from the sensor. I have read the datasheet which specifies to check the stat reg
Status Register Table
Status Register Table
Status Reg.jpg (171.07 KiB) Viewed 97 times
to see if the valid app is loaded and if FW_Mode is in boot or app mode. The sensor is confirming the status as Decimal 144 which translates that firmware is in application mode, Valid application firmware is loaded BUT no new data samples are ready?

I do not understand why this is as the sensor has been initiated properly, operating mode has been set to 001 and everything but still, no data samples are ready? The status register also does not indicate any errors either.

Now the datasheet specified to write to reg 0xF4 with no data to initiate the application and transition to App mode from Boot mode but the sensor already seems to be in App mode upon startup and when I do try and write to the register, the sensor is producing an error >> Decimal value 1 which translates to
Error Register Table
Error Register Table
Error Register.jpg (93.31 KiB) Viewed 97 times
"The CCS811 received an I²C write request addressed to this station but with
invalid register address ID". I'm writing Hex value 0x00 to register 0xF4 which is producing the error. Tries writing nothing and still the same thing.

Any Help is greately appreciated :)
CN04-2019_attachment_CCS811_Datasheet_v1-06.pdf
Data Sheet
(533.61 KiB) Not downloaded yet

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: CS811 Data Read Issues

Post by adafruit_support_carter »

There's an Arduino library:
https://github.com/adafruit/Adafruit_CCS811
and CircuitPython library:
https://github.com/adafruit/Adafruit_Ci ... hon_CCS811
that might help as a reference.

User avatar
moh0058
 
Posts: 3
Joined: Wed May 11, 2022 2:28 pm

Re: CS811 Data Read Issues

Post by moh0058 »

Thanks for the response but unfortunately, as part of the subject requirement is to create our own libraries so I'm unable to use the provided library. I have looked through it before and have tried to understand how it works but it is somewhat different to what I have come up with.

My primary issue is why the sensor is not providing data back when everything else has been setup?

User avatar
moh0058
 
Posts: 3
Joined: Wed May 11, 2022 2:28 pm

Re: CS811 Data Read Issues

Post by moh0058 »

Okay so a lot more diagnosing and the issue seems to be with me trying to write to the APP_START reg.

The sensor is producing an error when trying to write to the reg, address is 0xF4 according to the datasheet but when trying to do a 'write with no data', essential I'm doing a write to the register with 0x00 as the data but the sensor is producing an error and when reading the error register 0xE0, the error seems to be WRITE_REG_INVALID which again translates to The CCS811 received an I²C write request addressed to this station but with
invalid register address ID.

Can someone please help identify possible causes for the issue? I have tried writing to other register's and its being written successfully except for this one :(

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: CS811 Data Read Issues

Post by adafruit_support_mike »

Your best bet will probably be to check with the manufacturer:

https://ams.com/technical-support

That's very much within the normal parameters of writing a device support library in real-world applications.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”