Hello there,
I would like to sample a voltage with the NHS3152 over a time of about 300 ms (about 30 samples).
This works quite well so far. However, I noticed that the precision and accuracy of the measurements is quite below these given in the data sheet (Noise of 11 LSB at 1V).
So I connected the ADC to a power source of exactly 0.5 V and sampled it. The voltage is relatively "clean" when I measure it with another device (NI MyDaq - picture with yellow line), but the values I read out with the NHS3152 are not (picture with the blue line; Noise of > 100 LSB).
(BTW: To avoid problems with the power supply I already used the development board with a battery.)
Hence my consideration or question if I do something wrong with the configuration of the ADC.
Thanks in advance
BR David


Here are the important poarts of my code:
void InitADC (void){
Chip_IOCON_SetPinConfig(NSS_IOCON, IOCON_ANA0_5, IOCON_FUNC_1)
Chip_ADCDAC_Init(NSS_ADCDAC0);
Chip_ADCDAC_SetMuxADC(NSS_ADCDAC0, ADCDAC_IO_ANA0_5);
Chip_ADCDAC_SetInputRangeADC(NSS_ADCDAC0, ADCDAC_INPUTRANGE_NARROW);
Chip_ADCDAC_SetModeADC(NSS_ADCDAC0, ADCDAC_SINGLE_SHOT);
}
void DoMeasurement(){
InitADC();
MeasurementNo++;
Chip_GPIO_SetPinOutHigh(NSS_GPIO, 0, 7); // Power Sensor on
for(int i = 0; i < CURVE_SAMPLES; i++) {
Chip_ADCDAC_StartADC(NSS_ADCDAC0);
while (!(Chip_ADCDAC_ReadStatus(NSS_ADCDAC0) & ADCDAC_STATUS_ADC_DONE)) {
; /* Wait until measurement complete.*/
}
MeasrementValues[i] = (int16_t) Chip_ADCDAC_GetValueADC(NSS_ADCDAC0);
Chip_Clock_System_BusyWait_us((uint32_t) (SAMPLING_INTERVAL));
}
Chip_GPIO_SetPinOutLow(NSS_GPIO, 0, 7); // Power Sensor off
DeinitADC();
}