This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

INA236: Configuration setting

Part Number: INA236

Hi,

I am doing a design with INA236. I am trying to follow the datasheet for configuration, but the calculation and setting don't make much sense. Here it is:

Rsense = 0.1 Ohm

Imax - 0.2048A (I selected it for "easier" conversions).

Configuration register: set the bit ADCRANGE = 1, which sets the range to 20.48mV, resolution 0.625µV/LSB

CURRENT_LSB (min) = 0.2048A ÷ 215 = 0.00000625A=> 6.25µA

CURRENT_LSB = CURRENT_LSB (min)

Shunt calibration register:

SHUNT_CAL = 0.00512 ÷ (0.00000625A × 0.100Ohm) ÷ 4 = 2048.

 

Current [A] = CURRENT_LSB × CURRENT (from the CURRENT register).

 

Example:

If the current is 0.2A (about 4.8W of power), then:

The voltage on the shunt is 0.2A × 0.1 Ohm = 20mV (very close to the maximum of 20.48mV).

Shunt Voltage Register = 20mV ÷ 0.000625mV = 32000 (maximum is 32768).

Current Register = Shunt Voltage Register × Calibration Register = 32000 x 2048 = 65536000???

I expect to see the number that represents the current of 0.2A. but I get 65536000. Where is my error?

Thank you.

  • Hi,

    Current Register to expect = Current/current_LSB = 0.2A/6.25uA = 32000.

    Current (in A) can be calculated either from shunt voltage (in V, divide by 0.1Ohm). or from Current Register decimal reading (multiply by current_LSB)

    Regards, Guang  

  • OK, I understand the first method: by reading the Shunt Voltage register and using the known shunt resistor value:

    From Shunt Voltage Register, the current can be calculated:

    32000 × 0.000625mV = 0.02V; I = 0.02V ÷ 0.1 Ohm = 0.2A.

    Or, by dividing the value from the Shunt Voltage Register by 160: 32000 ÷ 160 = 200 (mA).

    The second method that you mentioned, I don't understand. In my case, it would give some garbage:

    Current Register = Shunt Voltage Register × Calibration Register = 32000 x 2048 = 65536000; 

    Multiply by Current_LSB: 65536000 x 0.00000625 = 409.6 (Amperes?) Also, if all registers are 16 bit, 65536000 will not fit in it.

  • Hi Dimitri,

    I see the reason why the math doesn’t add up.

    The current register value should be:

    Current Register = Shunt Voltage Register × Calibration Register / 2048 = 32000 x 2048(Cal_reg) /2048= 32000.

    The constant 2408 (not the Cal register value) is an internal scaling factor.

    BTW, current register is read-only, we don’t really need to worry about how its value is derived internally.

    Regards, Guang  

  • Hi Guang,

    Is the voltage register equal the current register, or it is just a coincidence? (Both of them are 32000 in my example).
    OK, so the current register is 32000. In order to calculate the correct current in mA (200mA), I need to divide 32000 by 160. That what it looks like I need to do. Where is 160 coefficient coming from?
    Thank you.

  • Hi Dimitri,

    I don’t know where 160 comes from. That's not how current is calculated

    Instead, multiply Current Register with Current_LSB:

    320000 * 6.25uA = 200mA.

    Regards, Guang