Skip to content

Commit a3b1464

Browse files
committed
Set ADC ACQTIME to 40us in nrf
In the pinetime, the battery is connected with a 1MOhm resistor, so 3us isn't enough to measure it. The battery is the only place where the ADC is used in the pinetime, so it's ok to hardcode the new value, but it'd be better to make it configurable if contributing upstream. Fixes wasp-os/wasp-os#254 For more details see the same issue in infinitime: InfiniTimeOrg/InfiniTime#483 Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
1 parent 6df2db3 commit a3b1464

File tree

1 file changed

+1
-1
lines changed
  • ports/nrf/modules/machine

1 file changed

+1
-1
lines changed

ports/nrf/modules/machine/adc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ STATIC mp_obj_t machine_adc_make_new(const mp_obj_type_t *type, size_t n_args, s
143143
.resistor_n = NRF_SAADC_RESISTOR_DISABLED,
144144
.gain = NRF_SAADC_GAIN1_4,
145145
.reference = NRF_SAADC_REFERENCE_VDD4,
146-
.acq_time = NRF_SAADC_ACQTIME_3US,
146+
.acq_time = NRF_SAADC_ACQTIME_40US,
147147
.mode = NRF_SAADC_MODE_SINGLE_ENDED,
148148
.burst = NRF_SAADC_BURST_DISABLED,
149149
.pin_p = 1 + self->id, // pin_p=0 is AIN0, pin_p=8 is AIN7

0 commit comments

Comments
 (0)