- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
08-31-2017 11:41 AM
I am using the Si1133 to measure the UV (Channel 0), large white (Channel 1) and IR (Channel 2). However, it was not work normally after the configuration were set. I found that the I2C register, Response 0, was not increase after the IRQ_enable command was sent and the read data from the parameter table was wrong. It should be something wrong, but I cannot aware.
The sequence for the configurations was shown below,
1. Reset si1133 : I2C format to send command 0x0B, then 0x01.
2. Delay 10ms
3. Read register Response 0
4. Reset: I2C format to send command 0x0B, then 0x01
5. Read register Response 0
6. Reset command register : I2C format to send command 0x0B, then 0x00.
7. Read register Response 0
8. Set ADCCONFIG0: I2C format to send command to HostIn0, 0x18, 0x0B, 0x82
9. Read register Response 0
10. Set ADSENS0: I2C format to send command to HostIn0, 0x01, 0x0B, 0x83
11.Read register Response 0
12. Set ADCPOST0: I2C format to send command to HostIn0, 0x40, 0x0B, 0x84
13. Read register Response 0
14. Set MEASCONFIG0: I2C format to send command to HostIn0, 0x40, 0x0B, 0x85
15. Read register Response 0
16. Set Channel list: I2C format to send command to HostIn0, 0x07, 0x0B, 0x81
17. Read register Response 0
18. Set measrate_h ：I2C format to send command to HostIn0, 0x00, 0x0B, 0x9A
19. Read register Response 0
20. Set measrate_l : I2C format to send command to HostIn0, 0x7D, 0x0B, 0x9B
21. Read register Response 0
22. Set meascount0: I2C format to send command to HostIn0, 0x01, 0x0B, 0x9C
23. Read register Response 0
24.Reg_Irq_Enable: I2C format to send command 0x0F, 0x07
25. Read register Response 0
26. Start mode: I2C format to send command to 0x0B, 0x83
08-31-2017 11:51 AM
What do you mean by " I2C format to send command to HostIn0, 0x18, 0x0B, 0x82"? Is that an I2C write? Did you see RESPONSE0 increment after this command?
I've provided the function code for PARAM_WRITE and PARAM_READ in the attachment. Please follow that sequence for parameter register settings.
08-31-2017 11:23 PM
Yes, I am using I2C write.
As I developed the code by using assembly language, so the command send out sequence is "S+Slave ID+0+(wait ack from si1133)+HostIn0 Address+(wait ack from si1133)+parameter value+(wait ack from si1133)+command address+"10"+6 bit address field for the parameter+n+stop".
So, the meaning for " I2C format to send command to HostIn0, 0x18, 0x0B, 0x82" is "S+Slave ID+0+(wait ack from si1133)+HostIn0 Address(0x0A)+(wait ack from si1133)+parameter value(0x18)+(wait ack from si1133)+command address+(0x0B)"10"+6 bit address field for the parameter(0x82)+n+stop".
I confirmed the RESPONSE0 had incremented after each command, however, I still got a wrong result from RESPONSE1 after read parameter.
09-03-2017 09:36 PM
My read sequence is
1. Read Response0 +SlaveID+0+(ack from si1133)+Response0 Address(0x11)+(ack from si1133)+Sr+SlaveID+1+(ack from si1133)+(Data - Response0)+N+Stop
2.Write parameter location to command : S+SlaveID+0+(ack from si1133)+Cmd Address(0x0B)+(ack from si1133)+channel list location(0x41)+(ack from si1133)+stop
4.Read Response1 +SlaveID+0+(ack from si1133)+Response0 Address(0x10)+(ack from si1133)+Sr+SlaveID+1+(ack from si1133)+(Data - Response1)+N+Stop
RESPONSE0 register value increased after point 1 and 3. However, the data from Response 1 is incorrect.
09-04-2017 07:59 PM
pins configured as open drain? Yes, the pin for I2C SDA, SCL and INT were set to open drain
pullup resistor size? 5.1k ohm pull-up resistor for each pin
distance between master and slave? around 10mm, it is not too far away.
09-05-2017 10:50 AM
I don't see anything wrong in your sequence reading RESPONSE0 and RESPONSE1 registers. If you set CHLIST to 0x01, what value did you get reading it back? What about our parameter registers?
09-05-2017 08:28 PM
After I set Channel list to 0x01 and read the Response1, the value is 0x00.
Besides, I found that the read back data from Response0 showed the MCU state was in Sleep mode after each configuration command until the start command was sent out, then the state changed from Sleep to Running. Is it normal?
09-06-2017 10:45 AM
I'm not sure if the param write or param read is unsuccessful. Can you try to read ADCCONFIG0(0x02) register after reset? It should be default to 0x0F. If you fail to read 0x0F, can you try another part?
The sensor is in Sleep mode for the most of the time. It only wakes up to take measurements after the start command is issued. The duty cycle of the measurement depends on the configuration. Therefore, you may still see the sensor in Sleep mode after the start command.
09-07-2017 10:15 PM
You are right, Tony. the param_write did not operate successful on my code, so the reading was wrong after I read the register, Response1. I found that the si1133 datasheet gave me a wrong direction. The correct para_write sequence should be "S+slave address+0+(ack from si1133)+hostIn0 address+(ack from si1133)+parameter value+(ack from si1133)+"10+parameter address"+(ack from si1133)+stop.
But, I still cannot read the data from HostOutx successfully. The si1133 sensor never sends out the interrupt signal to the MCU. And I try to read the register, IRQ_STATUS, it always keep the value on 0b00000101. I should be turn on the channel 0, 1 and 2, so the value must change after the data is ready, but it doesn't. I am so confuse.
09-08-2017 10:16 AM
What's your configuration for Channel 1? Did you set IRQ_ENABLE register? Besides, please send us your schematic to review. Can you also probe the INT pin to check if it's ever pulled low?
09-10-2017 10:15 PM
My configuration for Channel 1 is
- ADCCONFIG1 set to 0b00001101
- ADSENS1 set to 0b00000000
- ADCPOST1 set to 0b01001000
- MEASCONFIG1 set to 0b01000000
I set IRQ_ENABLE register to 0b00111111 after all configuration commands, but before the START_Mode command. So, I think the interrupt operation for all six channel should be turned on.
I found that the INT pin for the si1133 always pulled low, should I set it to high level after Reset command manually?
My schematic was attached. It is same as the si1133 datasheet Figure 3.1. The SDA, SCL and INT pin were connected to MCU I/O pins.
09-11-2017 10:44 AM
If the INT pin is configured as open-drain and your schematic is the same as the one in the datasheet, the INT pin should be high after power-up. Can you double check?
When the interrupt occurs, the INT pin will be pulled low and it's the host's responsibility to read the IRQ_STATUS register to clear the interrupt and de-assert the INT pin (back to high again).
Your channel 1 configuration looks fine. You can set CHLIST to 0x02 and see if you can receive interrupts.
09-11-2017 10:17 PM
Now, I set the INT pin to high after power-up. However, the si1133 did not pull down the INT pin although I waited around 10 ms after I sent out the start command.
09-13-2017 10:35 AM
Can you read back IRQ_ENABLE register to see if it is set correctly?
It seems that you can read IRQ_STAUTS register to see the interrupt status, but couldn't receive the interrupt. If that's the case, then something is holding the INT pin high in your system.
09-13-2017 09:12 PM
The value of the IRQ_Enable register was correct when I read it.
But, I tried to set the CHAN_LIST to 0b00000010, after that I read the value of IRE_STATUS register, it still kept to 0b00000101. It did not make sense. However, I cannot find out the reason and I am not sure the si1133 whether start to function or not.
09-14-2017 10:34 AM
Did you set MEASCOUNT for channel 1? Is the MEASCOUNT the same for all channels?
Alternatively, you can use the forced mode measurement instead of the autonomous mode. Please see if that works.
I'd like to close the thread here and if you have further questions, please create a support ticket in our technical support system.