Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check status for tvoc #699

Merged
merged 8 commits into from
Jan 23, 2017
Merged

check status for tvoc #699

merged 8 commits into from
Jan 23, 2017

Conversation

zer0page
Copy link
Contributor

No description provided.

@divkam
Copy link
Contributor

divkam commented Nov 21, 2016

Just curious, why this change?

@zer0page
Copy link
Contributor Author

suspect updating the offset every sample somehow interferes with the tvoc internal algorithm

@mburnshello
Copy link
Contributor

let's also check the data ready status bit before sampling data. register 0x00 bit 3. pseudocode from manufacturer:
u8 *timer_routine_read_data(){
i2c_write(CCS_811_ADDRESS, STATUS_REG, i2c_buff, 0);
i2c_read(CCS_811_ADDRESS, i2c_buff, 1);
if(i2c_buff & 0x8) // check if data ready {
i2c_write(CCS_811_ADDRESS, ALG_RESULT_DATA, i2c_buff, 0); i2c_read(CCS_811_ADDRESS, i2c_buff, 4);
}
return i2c_buff; }

@zer0page
Copy link
Contributor Author

zer0page commented Nov 22, 2016

@mburnshello
@plasticchris

data_is_ready = true;
break;
}
vTaskDelay(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems short; is it based on measurements or datasheet info?

@zer0page
Copy link
Contributor Author

Didn't see anything in the spec sheet. This number is arbitrary, also don't
want to hog the semaphore for too long

On Nov 23, 2016 12:47 PM, "Chris Johnson" notifications@github.com wrote:

@plasticchris commented on this pull request.

In kitsune/i2c_cmd.c
#699 (review):

  • /*
  • * read status
  • */
  • int tries = 3;
  • bool data_is_ready = false;
  • while(tries-- > 0){
  • b[0] = 0;
    
  • (I2C_IF_Write(0x5a, b, 1, 1));
    
  • memset(b,0, sizeof(b));
    
  • I2C_IF_Read(0x5a, b, 1);
    
  • if(b[0] & 0x08){
    
  •     data_is_ready = true;
    
  •     break;
    
  • }
    
  • vTaskDelay(1);
    

this seems short; is it based on measurements or datasheet info?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#699 (review), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AFVvUUkDIvTIrPQzCBRcerJmRXgxiIBGks5rBKZpgaJpZM4K4o4w
.

@zer0page zer0page changed the title calibrate tvoc only once check status for tvoc Jan 3, 2017
@plasticchris plasticchris merged commit 13d1de6 into master Jan 23, 2017
@plasticchris plasticchris deleted the calibrate_once branch January 23, 2017 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants