This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OPT3001: Error State on Read Error

Part Number: OPT3001

We are operating at the OPT3001 at 1MHz as the only device on the I2C2 bus of an STM32F767 MCU.  We sample the OPT3001 every 2 seconds in End-of-Conversion Mode by writing 0xCA00 to the config register then waiting for the interrupt before reading the resulting value.  This may work perfectly for 12 hours or more, but eventually we get a read error (as reported by the CubeMX function HAL_I2C_Master_Receive).  Following this error, the OPT3001 acks and communicates correctly, however it appears that our writes to the config register (0xCA00) are shifted since the value reads back as xxCA rather than CAxx (logged in parentheses below).  When we detect this state, we issue a General-Call Reset Command by writing 0x06 to I2C address 0x00 as described in 7.5.1.2 of the datasheet, however this has no effect on the behavior of the OPT3001 as the registers continue to be shifted.  Only a power-cycle seems to restore normal operation.  How can we restore normal operation of this part short of a power-cycle.

ALS Start (0xCA00) ALS cLux: 4168
ALS Start (0xCA00) ALS cLux: 4160
ALS Start (0xCA00) ALS cLux: 4220
ALS Start (0xCA00) ALS cLux: 4248
ALS Start (0xCA00) ALS cLux: 4232
ALS Start (0xCA00) ALS cLux: 4232

ALS Start (0xCA00)

ERROR: Read_ALS_Register failed

Reset ambient light sensor

ALS Start (0x24CA) ALS cLux: 127008768

ALS Start (0xFFCA) ALS cLux: 126976000

ALS Start (0xFFCA) ALS cLux: 127008768

ALS Start (0xFFCA) ALS cLux: 127008768

ALS Start (0xFFCA) ALS cLux: 126976000

ALS Start (0xFFCA) ALS cLux: 127008768

  • Hi Michael,

    Thanks for your question. I just wanted to give a heads up that responses may be delayed due to the holidays. I will take a look at this tomorrow and let you know if I find anything. If I end up having to test in the lab this may have to wait till after the break.

    Best,

    Alex
  • Hi Michael,

    This one slipped through the cracks after I returned from break. Sorry about the big delay getting back on this.

    It sounds that the issue will happen randomly. Does it happen only under the certain setting that you mentioned? I am wondering if this is something I can try to replicate on a EVM here.

    When you issue the reset are the registers properly resetting to default values? The config register should reset to 0xC810 when you issue the reset. Just to double check, after issuing the reset, you write 0xCA00 to the config reg to reconfigure the device, correct?

    Also how are you logging the values shown in parenthesis? Is the MCU reading both the config and result registers every 2 seconds?

    Best,

    Alex
  • Michael,

    Has your issue been resolved. I am going to close the thread, but if you still need assistance from Alex feel free to reply to the thread
  • The issue has not yet been resolved, but I have not been able to circle back to capture more data as yet.  If you like, you may close it and I will open a new thread when I have more time to attack the problem.

    Regards,

    --Mike

  • Mike,

    Sounds good! Let us know when you are ready to continue the debug.