Hello NXP Community,
i have a NHS3152 Demoboard and i want to measure the resistance with two Pins.
The resistor is connected to ANA1 and ANA4.
To do this, I switched on the digital to analog converter at pin ANA1 and set it to a continuous voltage of 1.25 Volts. Then I switched on the analog to digital converter and measured the voltage.
To measure the current I first switched off the AD-converter and "disconnected" it from the pin. Then the I2D unit is connected to the pin and the current is measured.
The results nearly correspond to the real resistance. However, the resistance always deviates by about 10k.
My question is now whether I proceed correctly with the measurement and how I find simply the correct scaling of the current for arbitrary resistances.
Maybe, there is an easier way to do this?
Solved! Go to Solution.
Hello Tom,
The best results require a different sequence.
The resistor can now be calculated as (v1-v4)/a
Some notes:
Kind regards,
Dries.
Hello Tom,
The best results require a different sequence.
The resistor can now be calculated as (v1-v4)/a
Some notes:
Kind regards,
Dries.
Hello Dries
Please help me.How do I convert “int Chip_I2D_GetValue()” to “**mA” ? What is the formula? for example ,how much mA when the value is 2570 . I used the code of "Therapy Adherence Demo Application" to init.
Best
Rex
/** * Starts an I2D conversion, waits for completion and returns the I2D value * @pre proper I2D mux should be set. * @return The I2D conversion result in native value (12bits). */
static int GetI2D(void)
{
Chip_I2D_Start(NSS_I2D);
while (!(Chip_I2D_ReadStatus(NSS_I2D) & I2D_STATUS_CONVERSION_DONE))
{
; /* Wait until the conversion is finished. */
}
return Chip_I2D_GetValue(NSS_I2D);
}
Hi Rex,
Have a look here: https://community.nxp.com/thread/515267#comment-1222869
That thread is hopefully helpful to you.
Kind regards,
Dries.
Hi Dries
I have read the link https://community.nxp.com/thread/515267#comment-1222869 .But the link only talk about how to Convert the voltage,not talk about how to convert current. I want to know how to convert current "(Chip_I2D_GetValue(NSS_I2D))" .
Best
Rex
I'm sorry about that, I misread. The I2D SW driver provides an API to do just that: Chip_I2D_NativeToPicoAmpere
You can also have a look at the firmware documentation: <SDK>/docs/firmware.html > Documentation of the low-level HW block drivers > i2d: Current to Digital converter driver > Example 1 - Single shot conversion with polling.
Best,
Dries.
A further question which arises to the topic: If you measure the voltage drop across the resistance, a certain current flows. The question now is whether the same current also flows when you measure the current through the resistor? It is possible that the ADC and I2D units have different input resistors. Or is this effect negligible ? This would falsify the measurement.