Skip to content

Commit da9b308

Browse files
msalauaescolar
authored andcommitted
drivers: adc: saadc: Disable burst mode on unused channels
Burst mode enabled on an unused channel causes a freeze during a conversion consisting of several channels (not including the one with burst mode enabled). Discovered on nRF52832 (nRF52-DK) using the following approach: channels 0-3 are used for application purposes as a sequence channel 4 is used for battery measurements with oversampling After few successful conversions the sequence (channels 0-3) freezes the thread while waiting for semaphore to end the conversion. Signed-off-by: Maksim Salau <[email protected]>
1 parent 37d62c6 commit da9b308

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/adc/adc_nrfx_saadc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ static int start_read(const struct device *dev,
479479
m_data.positive_inputs[channel_id]);
480480
++active_channels;
481481
} else {
482+
nrf_saadc_burst_set(
483+
NRF_SAADC,
484+
channel_id,
485+
NRF_SAADC_BURST_DISABLED);
482486
nrf_saadc_channel_pos_input_set(
483487
NRF_SAADC,
484488
channel_id,

0 commit comments

Comments
 (0)