interfacing OPT4001 ambient light sensor with RT1170 with I2C

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

interfacing OPT4001 ambient light sensor with RT1170 with I2C

878 Views
sajithdevidas
Contributor III

Hi all,

I'm currently working with an OPT4001 ambient light sensor and need to interface it with an RT1170 using I2C. My goal is to continuously read a specific value from the result register of the OPT1170. I am relatively new to RT1170 boards and I2C. I am using MCUXpresso and the SDK example "evkmimxrt1170_lpi2c_polling_b2b_master_cm7."

Could anyone guide me on how to correctly achieve this and retrieve values from the sensor? I have attached the datasheet of the OPT4001 for reference. Any assistance would be greatly appreciated.

Thank you.

 

0 Kudos
Reply
1 Reply

864 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @sajithdevidas,

The evkmimxrt1170_lpi2c_polling_b2b_master_cm7 would be a good starting point, but considering that you probably will use the continuous mode (as you mentioned that you wish "to continuously read a specific value from the result register"), I would use the evkbmimxrt1170_lpi2c_interrupt_cm7 instead, and have RT receive the data by interruptions rather than polling.

EdwinHz_0-1702331906134.png

This way, the INT pin can be used to detect incoming data and read it with the RT1170

EdwinHz_1-1702332182465.png

I hope this helps.

BR,
Edwin.

 

0 Kudos
Reply