After nrfx_saadc_mode_trigger, power consumption raised 1.3mA and not drop.

Hi,

I am working on ncs 2.9.1 @ nRF54L15.

I followed this academy course to add a single channel saadc in simple mode:

	/* STEP 5.1 - Connect ADC interrupt to nrfx interrupt handler */
	IRQ_CONNECT(DT_IRQN(DT_NODELABEL(adc)), DT_IRQ(DT_NODELABEL(adc), priority), nrfx_isr, nrfx_saadc_irq_handler, 0);

	/* STEP 5.2 - Initialize the nrfx_SAADC driver */
	nrfx_err_t err = nrfx_saadc_init(DT_IRQ(DT_NODELABEL(adc), priority));
	if (err != NRFX_SUCCESS) {
		LOG_ERR("nrfx_saadc_mode_trigger error: %08x", err);
		return -1;
	}

	/* STEP 5.3 - Configure the SAADC channel */
	channel.channel_config.gain = NRF_SAADC_GAIN1_4;
	err = nrfx_saadc_channels_config(&channel, 1);
	if (err != NRFX_SUCCESS) {
		LOG_ERR("nrfx_saadc_channels_config error: %08x", err);
		return -1;
	}

	/* STEP 5.4 - Configure nrfx_SAADC driver in simple and blocking mode */
	err = nrfx_saadc_simple_mode_set(nrfx_saadc_channels_configured_get(), NRF_SAADC_RESOLUTION_12BIT, NRF_SAADC_OVERSAMPLE_DISABLED, NULL);
	if (err != NRFX_SUCCESS) {
		LOG_ERR("nrfx_saadc_simple_mode_set error: %08x", err);
		return -1;
	}

	/* STEP 5.5 - Set buffer where sample will be stored */
	err = nrfx_saadc_buffer_set(&sample, 1);
	if (err != NRFX_SUCCESS) {
		LOG_ERR("nrfx_saadc_buffer_set error: %08x", err);
		return -1;
	}
	
	err = nrfx_saadc_offset_calibrate(NULL);
		if (err != NRFX_SUCCESS) {
			LOG_ERR("nrfx_saadc_offset_calibrate error: %08x", err);
			return rc;
		}

		/* Step 7.2 - Trigger the sampling */
		err = nrfx_saadc_mode_trigger();
		if (err != NRFX_SUCCESS) {
			LOG_ERR("nrfx_saadc_mode_trigger error: %08x", err);
			return rc;
		}

		/* STEP 7.3 - Calculate and print voltage */
		int adc_voltage = ((900 * 4) * sample) / ((1<<12));
		int battery_voltage = adc_voltage * 1220 / 220;

		LOG_DBG("SAADC sample: %d Battery Voltage: %d mV", sample, battery_voltage);
	

ADC read works properly, but the current read from PPK2 raised from 30uA to 1.3mA when nrfx_saadc_mode_trigger been called.

How to disable saadc after sampling is triggered?

I tried call nrfx_saadc_abort but the current is still high

Regards,

Anthony

Parents
  • I stumbled on another solution. Sharing it in case it helps anyone else in the future. Increase the ADC acquisition time to 10μs or larger.

    I am using nRF52832, and haven't tested this on nRF54L

    Instead of calling nrfx_saadc_abort() to manually activate the STOP task in the ADC peripheral. What worked also for me is to increase the ADC acquisition time from 3μs to 10μs.

    Another benefit in increasing the acquisition time is it allows the CPU to work in refresh mode. Which means the internal voltage regulator are more efficient.

    To quote docs.nordicsemi.com/.../saadc.html

    > When tACQ is 10us or longer, and if DC/DC is active, it will be allowed to work in refresh mode if no other resource is requiring a high quality power supply from 1V3. If tACQ is smaller than 10us and DC/DC is active, refresh mode will not be allowed, and it will remain in normal mode from the START task to the STOPPED event. So depending on tACQ and other resources' needs, the appropriate base current needs to be taken into account.

Reply
  • I stumbled on another solution. Sharing it in case it helps anyone else in the future. Increase the ADC acquisition time to 10μs or larger.

    I am using nRF52832, and haven't tested this on nRF54L

    Instead of calling nrfx_saadc_abort() to manually activate the STOP task in the ADC peripheral. What worked also for me is to increase the ADC acquisition time from 3μs to 10μs.

    Another benefit in increasing the acquisition time is it allows the CPU to work in refresh mode. Which means the internal voltage regulator are more efficient.

    To quote docs.nordicsemi.com/.../saadc.html

    > When tACQ is 10us or longer, and if DC/DC is active, it will be allowed to work in refresh mode if no other resource is requiring a high quality power supply from 1V3. If tACQ is smaller than 10us and DC/DC is active, refresh mode will not be allowed, and it will remain in normal mode from the START task to the STOPPED event. So depending on tACQ and other resources' needs, the appropriate base current needs to be taken into account.

Children
No Data
Related