cancel
Showing results for 
Search instead for 
Did you mean: 

TSC1641 power monitor IC dc power register cannot be read

fog.1
Associate III

i bought a TSC1641 evaluation board, I can't read the power information from the DC power register. I can successfully read shunt voltage, current, load voltage data.

the configuration is as follows:

Rshunt register value = 0x01F4; the shunt resistance on my semim development

board is 5 mili ohms.(decimal=500).

configration register value = 0x0037; conversion time 1024 µs (default),

7h: shunt and load voltage, continuous mode (default).

 

I check the FLAG register data zeroth (CVNF) bit to see if the data is ready,

but regardless of this, I do a reading at any time.does this cause problems

with reading dc power information?

 

fog1_0-1719484237228.png

 

11 REPLIES 11

Print the value you're actually getting from the register - maybe the problem is in your calculation?

Correction:

AndrewNeil_0-1719484777128.png

What you're printing here is somehow arriving via a pointer - have you checked the point at which it's actually read from the chip?

Please use this button to properly post source code - rather than a screenshot:

AndrewNeil_2-1719484915476.png

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

the decimal value I got from the recording is zero. therefore, the result of the multiplication used from the calculation of the actual power is also zero

fog.1
Associate III

I am printing the value I read from the recording on the screen. the value returns as zero.

Sorry - I corrected the post:

What you're printing here is somehow arriving via a pointer - have you checked the point at which it's actually read from the chip?

What do you mean by "recording" ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

By "register" I mean DC POWER REGISTER.

ret = HAL_I2C_Mem_Read(&hi2c1, (uint16_t)0x81 , (uint16_t)REG, (uint16_t)1, Read_reg_data, (uint16_t)2, 50);

I perform a read operation with a length of 2 bytes and the value read from the

corresponding record is transferred to the variable "read_reg_data". the content

of this variable is zero when the reading process is finished.

fog.1
Associate III

Ekran Görüntüsü (1255).png

OK - you didn't show that before.

 

ret = HAL_I2C_Mem_Read(&hi2c1, (uint16_t)0x81 , (uint16_t)REG, (uint16_t)1, Read_reg_data, (uint16_t)2, 50);

do you check the value of ret - to see that the read was actually successful?

 


@fog.1 wrote:

By "register" I mean DC POWER REGISTER


So "recording" was just a typo for "register" ?

AndrewNeil_0-1719490063419.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

I'm checking the "rejection" value. there is no mistake. the rejection value appears as "HAL_OK". in addition, everything is normal when I check the "SDA" line on the "I2c" interface with the logic analyzer.

 the same "I2C" reading function is used in these two operations. he from both "return= HAL_OK."

Ekran Görüntüsü (1256).png

 

Ekran Görüntüsü (1257).png

 

as I said, all other recording values can be read successfully, but only the "dc power recording" value returns as zero when the reading is done.

 

 

 

 

OK - out of ideas, then.

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.