- Edited
Hello,
I'm working with the BL706 and trying to figure out the optimal ADC settings.
I have the settings setup for 3.2V as the VRef and the PGA set to "None".
I'm finding that measuring 3.2V is reading around 42000 rather than the expected 65535.
This is leaving around 35% of the reading range unusable.
Is there a reccomended set of settings to use to be able to use the full resolution when using the 3.2V VRef? Using the 2.0V VRef works fine.
I have tested on 4 different chips and results are repeatable across devices.
I'm using GPIO_PIN_19
/ADC_CHAN9
, with the ADC in scan mode scanning a set of three pins.
This is the settings that I'm using for setting up the ADC:
adc_cfg.clkDiv = ADC_CLK_DIV_4;
adc_cfg.vref = ADC_VREF_3P2V;
adc_cfg.resWidth = ADC_DATA_WIDTH_16_WITH_128_AVERAGE;
adc_cfg.inputMode = ADC_INPUT_SINGLE_END;
adc_cfg.v18Sel = ADC_V18_SEL_1P72V;
adc_cfg.v11Sel = ADC_V11_SEL_1P1V;
adc_cfg.gain1 = ADC_PGA_GAIN_NONE;
adc_cfg.gain2 = ADC_PGA_GAIN_NONE;
adc_cfg.chopMode = ADC_CHOP_MOD_ALL_OFF;
adc_cfg.biasSel = ADC_BIAS_SEL_MAIN_BANDGAP;
adc_cfg.vcm = ADC_PGA_VCM_1P6V;
adc_cfg.offsetCalibEn = ENABLE;
adc_cfg.offsetCalibVal = 0;
And then reading the values from the FiFo via interrupts.
Edit:
Should note that I'm using the mcu sdk; from commit 8742503a9e9aaa36462767b300f3c22b2935cc5e
.
I'm not using the hal layer as the vfs indirection adds too much overhead, so I'm working with the drivers directly.