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

MLX90621_SetRefreshRate erase all other bit #5

Open
Olfox59 opened this issue Jun 20, 2020 · 1 comment
Open

MLX90621_SetRefreshRate erase all other bit #5

Olfox59 opened this issue Jun 20, 2020 · 1 comment

Comments

@Olfox59
Copy link

Olfox59 commented Jun 20, 2020

Hi,

Thanks for the driver.

But i updated my previous driver with this one. The probleme is that when I use SetRefreshRate, it clear all the bit, even POR bit. As i check this bit to know if i need to reprogram oscillator via Configure. It always do it as the bit as been cleared . So idea should be to read configuration, do an OR with refresh rate and write register . I did it and check is working :

`
int MLX90621_SetRefreshRate(uint8_t refreshRate)
{
uint16_t cfgReg;
int value;
int error;
confReg test;

//value = refreshRate & 0x0F;

error = MLX90621_GetConfiguration(&cfgReg);
    
if(error == 0)
{

    value = (cfgReg & 0xfff0) | (refreshRate & 0x0F);
    //value = (cfgReg & 0x000F) | value;
    error = MLX90621_I2CWrite(0x60, 0x03, 0x55, value);        
}    

return error;

}`

@slavysis
Copy link
Collaborator

Indeed - using wrong mask value (000F instead of FFF0). It is fixed in the latest commit. Thanks a lot for the feedback!

Best regards

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

No branches or pull requests

2 participants