Tool/software:
Hi All,
The saga continues to calibrate a BQ40Z50R2!
The last piece of the puzzle is to calibrate the temperature readings, and still using a MCP2221 SMBus device.
We apply a known temperature, e.g. 21 degrees C
We then read out the TINT offset for the Internal temperature for example.
-smbw=14,40 -slave8=17 -register=00 -pec=off (read internal temperature offset, normally between -128 and 127 in 0.1 degrees C)
-smbr=3 -slave8=17 -register=23 -pec=off
This gives us
SMBus Read 3 bytes, Slave = 0x17, Reg Index = 0x23, PEC = Off
0x20, 0x7d, 0x78 (first byte ignored)
Where the offset in this case is 7D78 = 32120, 32767 - 32120 = 647 ??
then read temperature from DAstatus2 (72)
-smbw=72,00 -slave8=17 -register=00 -pec=off
-smbr=17 -slave8=17 -register=23 -pec=off
this gives us
SMBus Read 17 bytes, Slave = 0x17, Reg Index = 0x23, PEC = Off
0x10, 0xb, 0xc, 0x13, 0xc, 0x13, 0xc, 0x55, 0x12, 0x59, 0x12, 0x13, 0xc, 0, 0, 0x13, 0xc (first byte ignored)
Where AAaa is 0C0B = 3083 = 308.3 K = 35.15 degrees C
and to find out the new offset, do this calculation
Calculate temperature offset:
TINT offset = TEMPTINT – TINT + TINT offsetold = 21.0 - 35.15 + 647 (again, not too sure if correct) = 633, therefore new offset = 32767 - 633 = 32134 = 7D86
Write the new Internal Temp Offset value to data flash
-smbw=03,14,86,7D -slave8=17 -register=44 -pec=off
Then recheck the reading to see if it is nearer 21.0 degrees C
This doesn't seem to work, does anyone have any experience of doing this please?
Many thanks,
Steve
