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

GPIOTE+SAADC

Hi, I am facing some issue while working with both GPIOTE and SAADC. I have merged the GPIOTE and SAADC sample example sdk code into a new project but what I am facing is the GPIOTE not getting monitored when SAADC is functions are called.

int main(void)
{
    const uint8_t leds_list[LEDS_NUMBER] = LEDS_LIST;
    LEDS_CONFIGURE(LEDS_MASK);

    gpio_init();

    saadc_sampling_event_init();
    saadc_init(m_buffer_pool);
    saadc_sampling_event_enable();

    while (true)
    {
        __WFE(); 
    }
}

In the above code i can find out that the control is going to the saadc_sampling_event_enable() function and I can find the ADC data in the buffer but the GPIOTE pin is not getting monitored, means the control is not going to in_pin_handler function if there is any changes done in the input PIN.

I suppose both are using interrupt but why both are not executing can't be understood.

Please reply ASAP as the task is on priority and I am new to NRF52832 Soc.

Regards, Amit

  • Hi Amit

    Try the following example code where I have combined SAADC example and pin_change_int example from SDK 11.0.0. I have just included the gpio_init function into the standard saadc code and included nrf_drv_gpiote.h into the project and enabled GPIOTE in the nrf_drv_config.h file. Now I see LED1 blink when I press button 1 on the nRF52-DK v1.1.0, and SAADC is sampling and outputting the samples on the UART at the same time.

    saadc_with_pin_change_int.zip

  • Hi Stefan, Thanks a lot for the reply. :-) I am unable to compile the project and getting the linking error for the undefined symbol 'nrf_drv_saadc_sample_task_get' I could not find the library where it is being defined. I am using Keil uVision5 and all the packs in the pack installer are up to date. Kindly can you let me know where can I find the definition of the same.

    Regards, Amit

  • Hi Stefan, Just missed to mention that I am using the up to date nrf driver 4.0.0-2.alpha (2015-12-18)

    Can you please suggest if I need to use any other version of nrf driver.

    Thanks in advance. :)

    Regards, Amit

  • Hi Amit

    We do not recommend using packs. We do not support it anymore in SDK 11.0.0. Just use normal folder structure, see this thread. When you are using normal folder structure in your project, we can take it from there.

  • Hi Stefan, I am very much thankful for your prompt response. It is bring to your notice that previously is had installed keil uVision 5 with pack installer and as you mentioned I downloaded the SDK 11.0 but I can not find any documentation on how to install the new SDK with the installed Keil 5. Please guide me ASAP. Sorry for bothering you so much as I am new to this.

    Regards, Amit

1 2