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.

OPT9221: OPT9221 sometimes returns 255 as a temperature reading from the LED board

Part Number: OPT9221
Other Parts Discussed in Thread: TMP103,

Hi,

We constantly probe the temperature of the LED board, to compensate for temperature drift and to allow us to back-off if the device gets too hot.

The temperature is read indirectly through the 9221. Intermittently we see the temperature value stuck at 255 (even though the actual temperature is nowhere near that). This is problematic as this is a valid temperature (= -1C) and not a high one, so there is a potential that an LED board over-heat would not be detected.

Is this a known issue? How would you recommend I handle this.

Also, is the LED temperature read synchronously? I.e. is it read by the 9221 when I read the illumination temperature register or is it read e.g. only with every frame. This will determine how we support reading from multiple LED thermistors.

Thanks

- Oliver

  • If you are using OPT8241-CDK-EVM, then external illumination has a temperature sensor TMP103C. This device operate by default, samples every 250 ms, but power-down in between. Each samples is 28 ms. I suspect the 255 read back is TMP103's response during sleep, because if I2C_SDA line is not driven, you'll get 255. www.ti.com/.../tmp103.pdf
  • Hi Larry,

    Thanks for the response. We have no control or even direct connection to the tmp103s, the tof controller handles this directly.

    We have two thermistors on our led board, which is taken from the reference design. What is the best way to read from both? Or how can i tell if one is broken and switch?

    If the thermistors are going to sleep, and reporting 255 when they do, then in 2s compliment, that's a valid temperature (-1). An overheat would likely be missed under these circumstances. Is there a register on the opt9221, which indicates a successful/failed read over i2c (ie a failure by the opt9221 you read the thermistors)?

    This is not the evk, we have been working with our own cameras (haddock and tintin) for a while now, though this issue has only cropped up with led boards overheating and blowing mosfets.

    Thanks
  • You made a good point. TMP103 is indeed sampled by OPT9221, and 255 is a valid value. Our reference design has only one external TMP103, and you get to program its device address. I have not encountered this issue on our CDK, but will find out more about how OPT9221 handles I2C master internally and get back to you.

    Meanwhile, do you have a I2C bus analyzer? If yes, I recommend try sniff the I2C bus directly and see if the sniffer is giving the same result as OPT9221.

    -Larry
  • Oliver,

    A read of 255 looks like a read on an empty bus or a wrong address. Can you confirm that you have programmed tillum_slv_addr (i2c master interface section in datasheet) register correctly? The temperature is read every frame and used for internal temperature calibration if enable.

    Also, does the issue occur intermittently during single power-on to power-off cycle or over multiple power cycles?

    Regards
  • Ah, thanks for the reply. I am beginning to suspect that the issue is with switching between thermistors. I can read from both thermistors on the led board, i suspect that there may be an issue if I'm constantly switching i2c address before reading (hence my earlier question, whether the temperature is updated synchronously or asynchronously to my register reads).

    I guess it would be safest to not switch and simply use one thermistors. Maybe switch to the alternate one, if there are issues with the first.

    I'll look at that tomorrow.
    Thanks
    - Oliver
  • OK. It does seem that changing between two temperature sensors is causing the problems and introducing a race condition, where the TOF controller can end up trying to read an invalid I2C address. 

    So for now, I'll read one sensor and shall assume that a value of 255 is indicative that the thermistor is defect or not connected. If that is the case, I can then switch to the second thermistor that we have on our board. I will just have to hope that the camera is never used in sub-zero temperatures - which I don't think will be an issue just now. It may be worth revisiting this on future designs/firmware to add an I2C status flag (e.g. a 9th bit of the temperature register reading) to denote failures in addressing a temperature sensor.

    Kind Regards

    - Oliver