Reply
Posts: 4
Registered: ‎12-07-2016

SI1133 - Does not measure

Hi,

i use the SI1133. But my problem is, that the sensor is running, but the value of IRQ_STATUS never changes, neither in Force mode nor in Running mode.

 

Here is my code for the communication:

void SI1133_init()
{
        // sensor_write(SENSOR, REGISTER, VALUE);
	// Lichtsensor einstellen
	// Reset Sensor
	sensor_write(PPG1, 0x0B, 0x01);
	_delay_ms(2);
	// SI1133_PARAM_CHLIST
	sensor_write(PPG1, 0x01, 0x01);
	// SI1133_PARAM_ADCCONFIG0
	sensor_write(PPG1, 0x02, 0x00);
	// SI1133_PARAM_ADCSENS0
	sensor_write(PPG1, 0x03, 0x02);
	// SI1133_PARAM_ADCPOST0
	sensor_write(PPG1, 0x04, 0x40);
	// SI1133_PARAM_MEASCONFIG0
	sensor_write(PPG1, 0x05, 0x00);
	
	// SI1133_IRQ_ENABLE - COMMAND
	sensor_write(PPG1, 0x0F, 0x01);
	
	SI1133_REG_COMMAND - SI1133_START
	sensor_write(PPG1, 0x0B, 0x13);	
	
}

For reading i waited for IRQ_STATUS will be not zero:

int8_t t = sensor_read(PPG1, 0x12);

Do you have an idea what iam doing wrong?

 

Thanks for support.

SolarTurtle

Posts: 25
Registered: ‎04-09-2015

Re: SI1133 - Does not measure

Hi,

 

There're two types of registers in the sensor, I2C registers and parameter registers. In order to write to the parameter register, you have to follow the sequence describe in section 5.3.1 in the datasheet. You cannot use normal I2C write functions to access parameter registers. There're 5 parameter register writes in your initialization code, but you actually wrote to I2C registers. 

 

Regards,

Tony

Posts: 4
Registered: ‎12-07-2016

Re: SI1133 - Does not measure

Hi Toni,

thank you for your fast answer.

 

I implemented your facts, but the IRQ_STATUS still does not change.

 

Now the code is:

void SI1133_init()
{
	// Lichtsensor einstellen
	// Reset Sensor
	sensor_write(PPG1, 0x0B, 0x01);
	_delay_ms(10);
	// SI1133_PARAM_CHLIST
	SI1133_writeParam(PPG1, 0x01, 0x01);
	// SI1133_PARAM_ADCCONFIG0
	SI1133_writeParam(PPG1, 0x02, 0x00);
	// SI1133_PARAM_ADCSENS0
	SI1133_writeParam(PPG1, 0x03, 0x02);
	// SI1133_PARAM_ADCPOST0
	SI1133_writeParam(PPG1, 0x04, 0x40);
	// SI1133_PARAM_MEASCONFIG0
	SI1133_writeParam(PPG1, 0x05, 0x00);
	
	// SI1133_IRQ_ENABLE - COMMAND
	sensor_write(PPG1, 0x0F, 0x01);
	
	// SI1133_REG_COMMAND - SI1133_START
	sensor_write(PPG1, 0x0B, 0x13);
		
}

with Parameter Function:

void SI1133_writeParam(unsigned char adr, unsigned char reg, unsigned char val)
{
	// CMD Register zurücksetzen
	sensor_write(adr, 0x0B, 0x00);
	// Read Response0
	uint8_t l = sensor_read(adr,0x11);

	// Write reg to INPUT0
	sensor_write(adr, 0x0A, val);
	
	// Write 0b10+reg to COMMAND
	sensor_write(adr, 0x0B, reg + 128);

	// Read Response0 and check if incremented
	uint8_t l1 = sensor_read(adr,0x11);
	
	if (l1 == l+1)
	{
		uart_puts("Good! \r");
	}
	
}

And i check every 200ms for the status:

		t = sensor_read(PPG1, 0x12);
		uart_putInt8(t);

Still a hint for me? :-(

 

Thanks for your help :-)

 

Posts: 25
Registered: ‎04-09-2015

Re: SI1133 - Does not measure

Hi,

 

You missed the configuration for MEASRATE register if you want to run autonomous measurement.

 

Regards,

Tony

Posts: 4
Registered: ‎12-07-2016

Re: SI1133 - Does not measure

Hi Tony,

 

i tried it some time ago. But this doesnt change.

The sensor does not measure althought i send a force message.

 

Here is the init again:

 

void SI1133_init()
{
	// Lichtsensor einstellen
	// Sensor reset
	sensor_write(PPG1, 0x0B, 0x01);
	_delay_ms(10);
	// SI1133_PARAM_ADCCONFIG0
	SI1133_writeParam(PPG1, 0x02, 0x00);
	// SI1133_PARAM_ADCSENS0
	SI1133_writeParam(PPG1, 0x03, 0x02);
	// SI1133_PARAM_ADCPOST0
	SI1133_writeParam(PPG1, 0x04, 0x40);
	// SI1133_PARAM_MEASCONFIG0
	SI1133_writeParam(PPG1, 0x05, 0x00);
	// SI1133_MEASRATE_H
	SI1133_writeParam(PPG1, 0x1A, 0x00);
	// SI1133_MEASRATE_L
	SI1133_writeParam(PPG1, 0x1B, 0x01);
	// SI1133_MEASCOUNT0
	SI1133_writeParam(PPG1, 0x1C, 0x01);
	// SI1133_MEASRATE_H
	SI1133_writeParam(PPG1, 0x25, 0x00);
	// SI1133_THRESHOLD0_H
	SI1133_writeParam(PPG1, 0x26, 0x00);
	// SI1133_THRESHOLD0_L
	SI1133_writeParam(PPG1, 0x01, 0x00);
	
	// SI1133_IRQ_ENABLE - COMMAND
	sensor_write(PPG1, 0x0F, 0x01);
	
	// SI1133_REG_COMMAND - SI1133_START
	sensor_write(PPG1, 0x0B, 0x13);
	
	
	
}

 

I think i despair :-)

Posts: 25
Registered: ‎04-09-2015

Re: SI1133 - Does not measure

Hi,

 

Here're a few issues with your configuration:

1. You missed setting the CH_LIST register

2. You should set ADCCONFIG0 to 0x18 if you want to take UV measurement

3. You should set MEADCONFG0 register to 0x40 to select the MEASCOUNT

4. The MEASRATE setting is too low. You don't need such a high sampling frequency. Try 0x7d (50Hz).

 

Regards,

Tony

Posts: 4
Registered: ‎12-07-2016

Re: SI1133 - Does not measure

Hi Tony,

 

Thanks for your help! It works now. 

Main problem war surely that the CHAN_LIST was set to 0x00, so i didnt enabled my channel.

 

Thank you very much!

SolarTurtle