Unable to configure ADC pin.

I am trying to configure Analogin_rev pin as ADC pin and I did the code changes, but I am getting the error -22 while trying to Configure ADC channel. Here is the snippet of the Analogin_rev pin and board overlay changes along with the code change. Can you please suggest what I am missing ?

How do I map the physical pin P1.11 to the ADC channel how shall I proceed on this ?

Parents
  • Hi,

    Thanks for the details. Actually on nRF54L15, SAADC inputs (AINx) are tied to specific physical pins and cannot be remapped in software (see nRF54L15 Product Specification Pin assignments). From the schematic you have provided, ANALOG_IN_REV is connected to P1.11, which corresponds to SAADC AIN4. Whereas the current configuration uses NRF_SAADC_AIN3 (which maps to P1.07), so the SAADC driver rejects the setup and adc_channel_setup() returns -EINVAL (-22).

    So please update the ADC configuration to use NRF_SAADC_AIN4 (and keep the channel index consistent, e.g. channel@4, reg = <4>). This should resolve the issue.

    Best Regards,
    Syed Maysum

Reply
  • Hi,

    Thanks for the details. Actually on nRF54L15, SAADC inputs (AINx) are tied to specific physical pins and cannot be remapped in software (see nRF54L15 Product Specification Pin assignments). From the schematic you have provided, ANALOG_IN_REV is connected to P1.11, which corresponds to SAADC AIN4. Whereas the current configuration uses NRF_SAADC_AIN3 (which maps to P1.07), so the SAADC driver rejects the setup and adc_channel_setup() returns -EINVAL (-22).

    So please update the ADC configuration to use NRF_SAADC_AIN4 (and keep the channel index consistent, e.g. channel@4, reg = <4>). This should resolve the issue.

    Best Regards,
    Syed Maysum

Children
Related