This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ADC and Capsense Simultaneous Usage

Hello,

I have a project that requires the use of the SAADC module for temperature measurement from an NTC Thermistor.

However, I will also like to use the CapSense touch features for User inputs (up to 4 touch buttons). Is there a possibility of doing this on the NRF52832 device.

I will really appreciate any useful feedback on how to achieve this.

Parents
  • Hi.

    Theoretically, it is possible to use the rest of the analog inputs of the SAADC for sampling other devices. The issue is that when more than 1 channel is enabled in the SAADC simultaneously, it will enter SCAN mode. SCAN mode will sample all active channels, one by one, and store the samples in a buffer. The CapSense driver is not written for supporting SCAN mode, and the SAADC is configurred with a single channels and a 1-sample buffer size for each sample. 

    You could enable your temperature input on a different SAADC channel, and increase the buffer size used in the CapSense driver to include the other channel, but this will result in your temperature measurement will be performed on every CapSense sample. You will also have to handle the temperature reading inside the SAADC handler in CapSense driver, and you will not have to rely on the CapSense sample triggers to sample your temperature sensor.

    Another solution would be to uninit the CapSense driver while sampling the temperature sensor. If this is a valid solution for your application will depend on the configuration, sample interval and required detection time of CapSense functionality.

    Best regards,
    Jørgen

Reply
  • Hi.

    Theoretically, it is possible to use the rest of the analog inputs of the SAADC for sampling other devices. The issue is that when more than 1 channel is enabled in the SAADC simultaneously, it will enter SCAN mode. SCAN mode will sample all active channels, one by one, and store the samples in a buffer. The CapSense driver is not written for supporting SCAN mode, and the SAADC is configurred with a single channels and a 1-sample buffer size for each sample. 

    You could enable your temperature input on a different SAADC channel, and increase the buffer size used in the CapSense driver to include the other channel, but this will result in your temperature measurement will be performed on every CapSense sample. You will also have to handle the temperature reading inside the SAADC handler in CapSense driver, and you will not have to rely on the CapSense sample triggers to sample your temperature sensor.

    Another solution would be to uninit the CapSense driver while sampling the temperature sensor. If this is a valid solution for your application will depend on the configuration, sample interval and required detection time of CapSense functionality.

    Best regards,
    Jørgen

Children
No Data
Related