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

How can I merge the Csense_drv and saadc application together?

Hello,

I am trying to sample capacitance change as well as voltage change from sensors. I combined the simplified sample codes from Csense_drv and saadc sample. If I only enable either csense_drv or saadc, I can read value. But if I combine them together, I always get "fatal" error. I understand csense_drv also use saadc (I disable COMP) but don't know where the conflict/problem is.

Can anybody take a look at my [source] file?

Thanks a lot! -Lei

Parents
  • Hi Jorgen, Thanks for your reply. I added a nrf_drv_saadc_uninit() after saadc application was done. I could get both voltage reading (from saadc) and cap reading (from csense), but then got another "fatal" error and restarted the program. I tried to debug the program. It seemed the error coming from app_timer_create (,, csense_timerout_handler). The program stuck in " while (loop);" in app_error.c. I could not see more detailed info about how this happened. I am wondering if there is a conflict between csense library and saadc liabrary. It seemed I had to uninitialize the saadc before doing csense sampling to get csense reading even with fatal error afterward.

    Can you please take a look at my code? Really appreciate it. I updated full Keil files in my original post.

Reply
  • Hi Jorgen, Thanks for your reply. I added a nrf_drv_saadc_uninit() after saadc application was done. I could get both voltage reading (from saadc) and cap reading (from csense), but then got another "fatal" error and restarted the program. I tried to debug the program. It seemed the error coming from app_timer_create (,, csense_timerout_handler). The program stuck in " while (loop);" in app_error.c. I could not see more detailed info about how this happened. I am wondering if there is a conflict between csense library and saadc liabrary. It seemed I had to uninitialize the saadc before doing csense sampling to get csense reading even with fatal error afterward.

    Can you please take a look at my code? Really appreciate it. I updated full Keil files in my original post.

Children
No Data
Related