Reply
Posts: 3
Registered: ‎08-26-2015

SI1132 CHIP_STAT issue

After soft reset, how to return "RUNNING" mode, and I attached the readout, run on Sleep mode, the LUX and IR output are unstable, the data record time are 1s.

Posts: 327
Registered: ‎09-22-2009

Re: SI1132 CHIP_STAT issue

 The device goes to sleep as much as it can to save power. It will be sleeping between measurements. You will only see it "running" when it is actively taking a measurement, which is only a short period of time at whatever duty cycle you set it to.

 

It seems like you don't have the IR_RANGE and VIS_RANGE bits set as described in section 2.3 of the datasheet:

 

https://www.silabs.com/Support%20Documents/TechnicalDocs/Si1132.pdf

 

 

Posts: 3
Registered: ‎08-26-2015

Re: SI1132 CHIP_STAT issue

The IR_RANGE and VIS_RANGE are set. see below 

 

void show_lux_uv_temp() {
command_param_set(_chlist, _en_aux + _en_als_ir + _en_als_vis); // Enable Lux / IR / AUX
command_write(_force);

lux_gain = B111;
ir_gain = B111;

do{
command_param_set(_ir_adc_gain, ir_gain);
command_write(_force);
ir_gain--;
} while ((command_response() == B10001101) && (ir_gain != 255));
ir_gain++;

command_param_set(_chlist, _en_aux + _en_als_vis); // Enable Lux / AUX
command_write(_force);

do{
command_param_set(_vis_adc_gain, lux_gain);
command_write(_force);
lux_gain--;
} while ((command_response() == B10001100) && (lux_gain != 255));
lux_gain++;

command_param_set(_chlist, _en_aux + _en_als_ir + _en_als_vis); // Enable Lux / IR / AUX
command_write(_force);

lux_gain = 1 << lux_gain;
ir_gain = 1 << ir_gain;

Serial.print("Gain Lux/IR : ");
Serial.print(command_param_query(_vis_adc_gain));
Serial.print(" / ");
Serial.print(command_param_query(_ir_adc_gain));
Serial.print(" ");

command_write(_force);
i2c_readout(SI1132, 0x22, 4, &val[0]);
reading = val[1] << 8;
reading |= val[0];
Serial.print("LUX : ");
space(5 - digit(reading / lux_gain));
Serial.print(reading / lux_gain);

lcd.setCursor(0,0);
lcd.print(" ");
lcd.setCursor(0,0);
lcd.print("Lux:");
lcd.setCursor(9 - digit(reading / lux_gain),0);
lcd.print(reading / lux_gain);

reading = val[3] << 8;
reading |= val[2];
Serial.print(" IR : ");
space(5 - digit(reading / ir_gain));
Serial.print(reading / ir_gain);

lcd.setCursor(0,1);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print("IR: ");
lcd.setCursor(9 - digit(reading / ir_gain),1);
lcd.print(reading / ir_gain);

command_param_set(_chlist, _en_aux + _en_als_ir + _en_als_vis); // Enable AUX
command_write(_force);
show_temp(" Temperature : ", 1,1);

command_param_set(_chlist, _en_uv + _en_als_ir + _en_als_vis); // Enable UV index
i2c_write_status(SI1132, ucoef0, 0x7B);
i2c_write_status(SI1132, ucoef1, 0x6B);
i2c_write_status(SI1132, ucoef2, 0x01);
i2c_write_status(SI1132, ucoef3, 0x00);
command_param_set(_vis_adc_misc, B100000);
command_param_set(_ir_adc_misc, B100000);
command_param_set(_vis_adc_gain, B0);
command_param_set(_ir_adc_gain, B0);
command_write(_force);
show_temp(" UV : ", 0,1);

Serial.println("");
}

Posts: 327
Registered: ‎09-22-2009

Re: SI1132 CHIP_STAT issue

Why are you setting the gain so high? It should be left default for the UV measurements, unless you are using a dark overlay.

Posts: 3
Registered: ‎08-26-2015

Re: SI1132 CHIP_STAT issue

Once, I set the IR_gain and is "0", the result also unstable.Is it missing some initial setting? According the datasheet without software flow and some parameters are miss understand. Can you show us the initial setting.

Highlighted
Posts: 327
Registered: ‎09-22-2009

Re: SI1132 CHIP_STAT issue

Are you following the command protocol as described in section 4.2 of the datasheet? Please verify your parameter settings are as you expect them to be by doing some parameter query commands.

 

The programmer's toolkit includes code examples that show how we set up the part. Please get the toolkit and then refer to the file Si114x_init.c in the Silabs subdirectory:

 

\Silabs\Optical_Sensors\Si114x\source\uv_slider\uv_demo\source

 

This code initializes an Si1146, which is an Si1132 with two IR LED drivers. You can just remove the PS1 and PS2 bits from the tasklist, and this initialization will work. This example code also has example UV calibration code in the file Si114x_functions.c.