NHS3152 Accuracy and Precision Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NHS3152 Accuracy and Precision Problem

995 Views
d_schoenfisch
Contributor I

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

Measurement with NHS.jpgMeasurement with MyDaq.jpg

 

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();
}

0 Kudos
3 Replies

951 Views
driesmoors
NXP Employee
NXP Employee

Hi,

When measuring, did you disconnect the SWD cable? The debug communication will inject additional noise.

BR,
Dries.

0 Kudos

945 Views
d_schoenfisch
Contributor I

Dear Dries,

 

Thanks for your answer. 

I have now removed the programmer as well as the the programmer cable.

Furhter I have added an additional " UngroundAnabus" in the code (although this is already done in the SetPinConfig and SetMux) and a " GroundAnabus" in the DeInit function. As suggested in the other post.

Furthermore I tried another input (AN1).

The measurement at 0.5V now looks like this:

Measurement with NHS 3_2.jpg

A bit different than before but still not as it should be according to the data sheet.

 

What I noticed here is that the "noise" is always a little bit higher at the beginning of each measurement and then it becomes a little bit lower (at about 150ms).

 

 

BR David

0 Kudos

959 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi David,

I hope you are doing great.

All these buses are grounded by default.

During the operation of analog blocks (ADCDAC, I2D, C2D), analog bus(es) must be ungrounded.

This is ensured by usage of Chip_IOCON_SetPinConfig or by the respective analog block driver in its Chip_*_SetMux* function.

Please look at the Chip_IOCON_UngroundAnabus.

Regards,

Mario

 

0 Kudos