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

Using csense but also read analog voltages separately

I have been trying to find some help or an example of using a capacitive sense button with the csense library(in SAADC mode) but also read the voltage of my battery using SAADC. I know the csense library initializes the SAADC and the pad channels etc. but currently I can't figure out how to add a channel by the SAADC driver to read the voltage of my battery when the csense library is already initialized. Is it possible to do this at the same time? or do I have to uninit and reinit each driver separately when I want to use them?

I am using the nrf52832 by the way,

Parents
  • Hi,

    There is no simple way to do this, as the SAADC event handler is inside the csense_drv source file. I created a modified driver/library to sample VDD and pass the value to the application event handler, but this is a bit of a hack.

    The application is running fine, but I do not have any cap sense equipment to test that it is still working correctly. Extract the project to SDK 17.0.0 peripherals directory, to test it out.

    csense_vddsample.zip

    The alternative is to un-init/re-init the libraries between the two operations.

    Best regards,
    Jørgen

Reply
  • Hi,

    There is no simple way to do this, as the SAADC event handler is inside the csense_drv source file. I created a modified driver/library to sample VDD and pass the value to the application event handler, but this is a bit of a hack.

    The application is running fine, but I do not have any cap sense equipment to test that it is still working correctly. Extract the project to SDK 17.0.0 peripherals directory, to test it out.

    csense_vddsample.zip

    The alternative is to un-init/re-init the libraries between the two operations.

    Best regards,
    Jørgen

Children
Related