Hi,
In the I2C communication,the nRF52840 SoC is master, the sensor SCD 30 is slave. The sensor SCD 30 needs the clock stretching period, the period time is 12ms or 150ms.
The first step is to get data ready status, the I2C command is 0x0202. I used the following code to test, however, I didn't get the right response.
uint8_t cmd_code[] = {0x02,0x02}; uint8_t rx_buffer[] = {0xff,0xff,0xff}; ret_code_t err_code; err_code = nrf_drv_twi_tx(&m_twi_0, 0x61, cmd_code, sizeof(cmd_code) , false); APP_ERROR_CHECK(err_code); nrf_delay_ms(1000); err_code = nrf_drv_twi_rx(&m_twi_0,0x61, rx_buffer,sizeof(rx_buffer)); APP_ERROR_CHECK(err_code);
For the question, please help me to solve it, thanks a lot !
Sensirion_CO2_Sensors_SCD30_Interface_Description.pdfSensirion_CO2_Sensors_SCD30_Datasheet.pdf