Skip to content

Commit 501dba8

Browse files
committed
Fixed using VDD as analog reference
The analog gain is a bit confusing as the input range is calculated by dividing Vref by the gain not multiplying. Using VDD as ref results in an input range of (VDD/4)/gain therefore if a range of 0...VDD is needed gain must be 1/4 not 4 (check p363 of product spec)
1 parent 52752f3 commit 501dba8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/nRF5/wiring_analog_nRF52.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void analogReference( eAnalogReference ulMode )
9898
switch ( ulMode ) {
9999
case AR_VDD4:
100100
saadcReference = SAADC_CH_CONFIG_REFSEL_VDD1_4;
101-
saadcGain = SAADC_CH_CONFIG_GAIN_Gain4;
101+
saadcGain = SAADC_CH_CONFIG_GAIN_Gain1_4;
102102
break;
103103
case AR_INTERNAL_3_0:
104104
saadcReference = SAADC_CH_CONFIG_REFSEL_Internal;

0 commit comments

Comments
 (0)