Hi TI!
I need to reprogram a tps65218d0 externally with launchpad cc1352P2 via I2C.
The tps65218d0 is powered on and I can read the registers without problem, but I try to reprogram the registers and the registers always keep the default value).
Attached is a segment of my code to reprogram the address register 0x1A.
else if(CountertaskTPS65218 == 1)
{
CountertaskTPS65218++;
CountertaskTPS65218++;
I2C_Transaction i2cTransaction = {0};
writeBuffer[0] = 0x10; // Address Regiter to write (Password)
writeBuffer[1] = 0x67; // 0x1A xor 0x7D Value to write
readBuffer[0] = 0x00;
readBuffer[1] = 0x00;
i2cTransaction.slaveAddress = 0x24;
i2cTransaction.writeBuf = writeBuffer;
i2cTransaction.writeCount = 2;
i2cTransaction.readBuf = NULL;
i2cTransaction.readCount = 0;
I2C_transfer(i2c, &i2cTransaction);
writeBuffer[0] = 0x1A; // Address Regiter to write (Password)
writeBuffer[1] = 0x86; // Value to write
readBuffer[0] = 0x00;
readBuffer[1] = 0x00;
i2cTransaction.slaveAddress = 0x24;
i2cTransaction.writeBuf = writeBuffer;
i2cTransaction.writeCount = 2;
i2cTransaction.readBuf = NULL;
i2cTransaction.readCount = 0;
I2C_transfer(i2c, &i2cTransaction);
}
else if(CountertaskTPS65218 == 25)
{
CountertaskTPS65218++;
I2C_Transaction i2cTransaction = {0};
writeBuffer[0] = 0x10; // Address Regiter to write (Password)
writeBuffer[1] = 0x50;
readBuffer[0] = 0x00;
readBuffer[1] = 0x00;
i2cTransaction.slaveAddress = 0x24;
i2cTransaction.writeBuf = writeBuffer;
i2cTransaction.writeCount = 2;
i2cTransaction.readBuf = readBuffer;
i2cTransaction.readCount = 0;
I2C_transfer(i2c, &i2cTransaction);
}
else if(CountertaskTPS65218 == 26)
{
CountertaskTPS65218++;
I2C_Transaction i2cTransaction = {0};
writeBuffer[0] = 0x10; // Address Regiter to write (Password)
writeBuffer[1] = 0x1A;
readBuffer[0] = 0x00;
readBuffer[1] = 0x00;
i2cTransaction.slaveAddress = 0x24;
i2cTransaction.writeBuf = writeBuffer;
i2cTransaction.writeCount = 2;
i2cTransaction.readBuf = readBuffer;
i2cTransaction.readCount = 0;
I2C_transfer(i2c, &i2cTransaction);
}
else if(CountertaskTPS65218 == 27)
{
CountertaskTPS65218++;
I2C_Transaction i2cTransaction = {0};
writeBuffer[0] = 0x10; // Address Regiter to write (Password)
writeBuffer[1] = 0xCE;
readBuffer[0] = 0x00;
readBuffer[1] = 0x00;
i2cTransaction.slaveAddress = 0x24;
i2cTransaction.writeBuf = writeBuffer;
i2cTransaction.writeCount = 2;
i2cTransaction.readBuf = readBuffer;
i2cTransaction.readCount = 0;
I2C_transfer(i2c, &i2cTransaction);
}
Attached is a segment of my code to read the address register 0x1A.
else if(CountertaskTPS65218 == 2)
{
//Read the chip
CountertaskTPS65218++;
CountertaskTPS65218++;
I2C_Transaction i2cTransaction = {0};
writeBuffer[0] = 0x1A; // Address Regiter to read
writeBuffer[1] = 0x00; // Value to write
readBuffer[0] = 0x00;
readBuffer[1] = 0x00;
i2cTransaction.slaveAddress = 0x24;
i2cTransaction.writeBuf = writeBuffer;
i2cTransaction.writeCount = 1;
i2cTransaction.readBuf = NULL;
i2cTransaction.readCount = 0;
I2C_transfer(i2c, &i2cTransaction);
i2cTransaction.writeBuf = NULL;
i2cTransaction.writeCount = 0;
i2cTransaction.readBuf = readBuffer;
i2cTransaction.readCount = 1;
I2C_transfer(i2c, &i2cTransaction);
if (StatusProgramming == 0 || readBuffer[0] != 0x86)
{
StatusProgramming = 0;
}
}
I always read 0x06, the default value of the 0x1A register, this register is never updated 0x80. The same with any other registers I try to edit.
Thank you very much. Best regards