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

Making use of multiple channels of SAADC

Hi,

In our application Csense driver is used.As it can be implemented using COMP and SAADC,due to mentioned limitations for COMP we opted to use SAADC.Only AIN7 is used right now for our purpose.In future it may require for us to make use of 4 different SAADC channels to monitor touch functionality.Besides,We also need to use two more channels inorder to monitor status of different sensors in certain intervals.

For my requirement I tried using Csense driver example and made use of AIN7 functionality to sense the capacitive touch,It was all fine.And then I tried using AIN4 and AIN6 to monitor the status of sensors like temperatur,.I found that channels are not getting initialized,because to initialize/uninitialize the channels first it should be in IDLE state.As of my knowledge ADC is kept busy using nrfx_saadc_buffer_convert() and as it is running through timer it is always kept busy,so i hope that might be the reason why other channels or not getting initialized.If my understanding is right please let me know what is the way adc_state can get back into IDLE state and will that itself helps me in initializing other channels used for sensors along with channel made use for csense drive?

Thank you.

Parents
  • Hi,

    There is only a single SAADC even though it has 8 channels, and it can either sample all channels in a row (scan) or single channels. I do not know the details of your application, but unless you have a strong reason for not doing so and want to put more effort into it, I suggest you either handle the capsensing or do saadc sensor readings. Something like the following:

    1. Initialize SAADC driver for sensor sampling
    2. Sample sensors
    3. Disable SAADC driver
    4. Initialize capsense library
    5. Do capasitive sensing for as long as needed or until nex sensor sampling
    6. Uninitialized capsense library
    7. jump to 1.

    If you sample sensors not very often and/or sampling takes a short time, then you may not actually notice any issues with capsense not being active all the time.

Reply
  • Hi,

    There is only a single SAADC even though it has 8 channels, and it can either sample all channels in a row (scan) or single channels. I do not know the details of your application, but unless you have a strong reason for not doing so and want to put more effort into it, I suggest you either handle the capsensing or do saadc sensor readings. Something like the following:

    1. Initialize SAADC driver for sensor sampling
    2. Sample sensors
    3. Disable SAADC driver
    4. Initialize capsense library
    5. Do capasitive sensing for as long as needed or until nex sensor sampling
    6. Uninitialized capsense library
    7. jump to 1.

    If you sample sensors not very often and/or sampling takes a short time, then you may not actually notice any issues with capsense not being active all the time.

Children
No Data
Related