locked
Ambient light sensor application RRS feed

  • General discussion

  • Hey ,

    Does anybody know how to handle the interrupt of an ALS in application ?

    Any sample code for the same ??

    Regards,

    Seetharam


    Seeth

    Tuesday, November 13, 2012 6:36 AM

All replies

  • Can you describe more deeply this ambient light sensor and the use of the interrupt? Wouldn't be possible to create a device driver for it?

    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Tuesday, November 13, 2012 9:22 AM
  • Hey Luca,

    I use Ambient light sensor to detect the brightness of the room environment. Interrupt will get generated once the value of the brightness exceeds the threshold value. 

    Device driver that I got does not have any interrupt handling procedure. I do not have an application too to test the driver. Now I am not getting any value for brightness when I read the data registers. Is there any sample test app or any app to implement the interrupt procedure.

    Seetharam


    Seeth

    Tuesday, November 13, 2012 9:43 AM
  • Do you have the source code of the driver? Which Windows CE version (5.0, 6.0, ...) are you targeting?

    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Tuesday, November 13, 2012 11:26 AM
  • Hey,

    I do not have the source code of the driver, I am developing it. I am using it on WEC7.

    I have a little confusion on interrupt handling in both driver as well as application. Not yet written the app.

    Seetharam


    Seeth

    Tuesday, November 13, 2012 11:37 AM
  • If you're writing the driver yourself,  you are in control of the BSP of your device and the ambient light sensor is connected appropriately to the main CPU you should be able to achieve what you want. I would suggest to read some books/tutorials on Windows CE development at first, for example:

    http://www.microsoft.com/windowsembedded/en-us/develop/windows-embedded-compact-7-white-papers.aspx

    http://www.microsoft.com/learning/en/us/exam.aspx?id=70-571&locale=en-us#tab3


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Tuesday, November 13, 2012 12:52 PM
  • I have developed the driver for ALS earlier and does developed an application to read the ALS (brightness information).

    If you can explain your requirement, may be i can help you in this regard.

    --- Misbah


    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Tuesday, November 13, 2012 7:05 PM
  • Hey Misbah,

    Thanks a lot for the reply. 

    My requirement for now is to read the ADC registers of the sensor and display. I2C configuration is done now. IC is getting powered.

    One doubt is when those ADC registers get the values filled? Later I need to implement the interrupt concept. 

    Regards,

    Seetharam


    Seeth

    Wednesday, November 14, 2012 5:10 AM
  • Thank you Luca.. 

    Regards,

    Seetharam


    Seeth

    Wednesday, November 14, 2012 5:10 AM
  • Hi ,

    What sensors make are you using ? As you said I2C communication is up, do you mean sensors are populating Ambient Light data in registers?



    Sr.Engineer

    Friday, November 16, 2012 12:42 PM
  • Hey all,

    Light data is getting updated in the registers and now I am able to read the registers from my application.

    Regards,

    Seeth


    Seeth

    Friday, November 16, 2012 2:16 PM
  • ALS works on configurable threshold of light sensitivity.

    If the lux value exceeds threshold it interrupts CPU.

    Driver shall read this lux value and copy to user buffer.

    This can be even implemented in polling mode also, if the ALS chip does not interrupt.

    In interrupt mode driver shall block the user call and unblock on interrupt.

    In polling mode application shall poll for the ALS data, which the driver shall provide on request.

    --- Misbah


    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Saturday, November 17, 2012 6:26 PM
  • Thanks a lot Misbah for your reply. 

    I am able to read the driver values and able to display it in application.

    Interrupt concept is not yet implemented.

    Seeth


    Seeth

    Monday, November 19, 2012 10:38 AM