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

Inconsistent ADC Behaviour with DFU

Hi all,

I have a working ADC implementation (S130 + Application) and use it to measure an analog input continuously.

However if I use the same code on top of bootloader (S130+DFU+Application), it starts acting weird. When I check the ADC values, I noticed that they are fluctuating in a large margin. What may cause this issue when I use the code with DFU but works as expected without DFU code?

Regards

Parents
  • An additional information: Problem is solved if I connect the analog circuit to NRF_ADC_CONFIG_INPUT_4 instead of NRF_ADC_CONFIG_INPUT_2. So the problem looks related to AIN2 when chip has DFU code. I am still looking for a solution :(

  • Hi Jorgen,

    I found the root cause of the problem but it looked like a bug on SDK and I still need a solution for this.

    I noticed that I set the pin 1 as output in bootloader code as follows:

    nrf_gpio_cfg_output(1); nrf_gpio_pin_set(1);

    But I am expecting the application code to reset this pin as input in my main code with the following code:

    nrf_gpio_cfg_input(1,NRF_GPIO_PIN_NOPULL);

    But it doesn't. Do you have any idea why it is not reset as input in application code or may you offer a workaround for me?

    Regards

Reply
  • Hi Jorgen,

    I found the root cause of the problem but it looked like a bug on SDK and I still need a solution for this.

    I noticed that I set the pin 1 as output in bootloader code as follows:

    nrf_gpio_cfg_output(1); nrf_gpio_pin_set(1);

    But I am expecting the application code to reset this pin as input in my main code with the following code:

    nrf_gpio_cfg_input(1,NRF_GPIO_PIN_NOPULL);

    But it doesn't. Do you have any idea why it is not reset as input in application code or may you offer a workaround for me?

    Regards

Children
No Data
Related