Hi,
I need to do small DataFlash update in the existing device with bq20z80DBT controller (ver1.02). I have no EV2300, so I use BusPirate's I2C capability.
The change is to switch the controller to use internal termistor only. So the target is Subclass 64.
Reading subclass ([ -means Start bit, ] - stop bit, r:33 - read 33 bytes):
[0x16 0x77 0x40 0x00][0x16 0x78 [0x17 r:33]
Gives the response:
0x08 ACK 0x0E ACK 0x29 ACK 0x3C ACK 0xD8 ACK 0x00 ACK 0x00 ACK 0x00 ACK 0x00 ACK 0x21 ACK 0x21 ACK ... rest of the bytes here to fill 32 bytes range
Response is correct, now I change first byte from 0x0E to 0x06 which sets Temp1,0 [4,3]: to – 0,0 = Only internal temperature sensor is used to generate Temperature.
(It's from Literature Number: SLUA380 June 2006 стр 79:)
Now writing:
[0x16 0x77 0x40 0x00][0x16 0x78 0x06 0x29 0x3C 0xDB 0x00 0x00 0x00 0x00]
All bytes sent are acknowledged with ACK signals but DataFlash is not updated. What am I missing?
The TechnicalReference (SLUU241A) says:
"""
Reading and Writing subclass data are block operations
which are 32 Bytes long each. but data can be written in shorter block
sizes. The final block in one subclass can be shorter than 32 bytes so
care must be taken not to write over the subclass boundary. None of the
values written are bounded by the bq20z80 and the values are not
rejected by the gas gauge. Writing an incorrect value may result in
hardware failure
due to firmware program interpretation of the
invalid data. The data written is persistent, so a Power On
Reset
does resolve the fault.
"""
Does it says that only _last_ block of subclass could be shorter? How about subclass 64 which is only 8-bytes long?
I was afraid to write 32-bytes there because of the warning above - to get out of boundary.
And I do not understand to if I corrupted DataFlash how Power On Reset could resolve the problem?
Thanks.