Skip to content

Commit

Permalink
Set ADC ACQTIME to 40us in nrf
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fgaz committed Apr 5, 2024
1 parent 76d3a53 commit f32e3d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ports/nrf/modules/machine/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static mp_obj_t mp_machine_adc_make_new(const mp_obj_type_t *type, size_t n_args
.resistor_n = NRF_SAADC_RESISTOR_DISABLED,
.gain = NRF_SAADC_GAIN1_4,
.reference = NRF_SAADC_REFERENCE_VDD4,
.acq_time = NRF_SAADC_ACQTIME_3US,
.acq_time = NRF_SAADC_ACQTIME_40US,
.mode = NRF_SAADC_MODE_SINGLE_ENDED,
.burst = NRF_SAADC_BURST_DISABLED,
},
Expand Down

0 comments on commit f32e3d4

Please sign in to comment.