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.

INA260EVM: Unable to set config register and mask/enable registers

Part Number: INA260EVM
Other Parts Discussed in Thread: SYSCONFIG, INA226, INA260

Hi TI team,

I try to verify INA260EVM functions from MCU. Reading manufactory and Die ID, voltage, current and power registers are all ok.

However I can not perform software reset or update configuration register.

sample codes:

static void dump_reg(void) {
	printf("dump: %04X; %04X; %04X\n", i2c_read_w(0x40, 0), i2c_read_w(0x40, 6), i2c_read_w(0x40, 7) );
	printf("measure: %04X; %04X; %04X\n", i2c_read_w(0x40, 1), i2c_read_w(0x40, 2), i2c_read_w(0x40, 3));
	printf("ID: %04X, %04X\n", i2c_read_w(0x40, 0xFE), i2c_read_w(0x40, 0xff));
}

// main loop
	{
		printf("power on\n");
		dump_reg();
		vTaskDelay(pdMS_TO_TICKS(300));

		printf("software config\n");
		i2c_write_w(0x40, 0x00, 0x6fff);
		vTaskDelay(pdMS_TO_TICKS(300));
		dump_reg();

		tprintf("software reset\n");
		i2c_write_w(0x40, 0x00, 0x8000);
		vTaskDelay(pdMS_TO_TICKS(300));
		dump_reg();
	}

The logs:

power on
dump: 6127; 0008; 0000
measure: 0000; 0000; 0000
ID: 5449, 2270
software config
dump: 61FF; 0008; 0000
measure: 0000; 0000; 0000
ID: 5449, 2270
software reset
dump: 6100; 0000; 0000
measure: 0000; 0000; 0000
ID: 5449, 2270

As logs show, I can not write the new config to configuration register.

After software reset, the config. register is 0x6100. (Not default value, 0x6127).

Would you please help provide correct register initialization sequence for reference ?

Thanks 

  • Hello Mike,

    Although you seem to be able to read register values correctly, it seems that there is a problem with your write function. For example, when you wrote 0x6FFF in your config, the readback showed 0x61FF. This would explain why you are not able to reset. To confirm, you could try to write a value to the alert limit register, and see if you can read back the same value. Also, note that when you reset the device, you will need to wait for the restart to take place before reading back values. 

    As for example code/initialization, we have a tool called SysConfig. SysConfig helps generate C code based on your desired configuration settings. Although the INA260 is not available in SysConfig yet, the INA226 is in SysConfig, and has a near identical register map. That can be found here: https://dev.ti.com/sysconfig/index.html?product=ascstudio&module=/ti/sensors/currentsensor/INA226.

    Regards,

    Mitch

  • Hi Mitch,

    Thanks for your suggestion. After some test, I found I did not send the high byte in i2c_write_word() function.

    After fixing the coding error, I could write configuration register. Also I could write and read back all uint16 values from alert limit register.

    Thanks

    BR, Mike

  • Hi Mitch,

    I don't see timeout requirement for INA260 software reset.

    Do you mean polling the reset bit of configuration register ?

    (Continue to configurate INA260 after the reset bit is cleared.)

    Thanks

    BR, Mike

  • Hey Mike, 

    I'm glad you were able to find the issue. Sorry for the confusion about reset, what I meant was that setting the reset bit is the same as power-on reset, so you'd need to wait for the device to boot back up:

    Regards,

    Mitch