Quantcast
Channel: Power management
Viewing all articles
Browse latest Browse all 80965

Forum Post: Cannot write to extended registers in bq27425

$
0
0

Hi,

I have a problem writing data to the extended registers. The data is not stored in RAM/NVS.

What I want to do is to change BIE (bit 5) in the Operation Configuration Register. My code looks like this using the I2C bus to set the registers in the bq27425.

  1. Set reg 0x3E (data class) to 82
  2. Set reg 0x3F (data block) to 0
  3. Set reg 0x61 (block data cntl) to 0
  4. Read 32 bytes of data from register 0x40 and onwards to buffer
  5. Read reg 0x60 (checksum = 0x54) just for verification
  6. Modify bit 5 to set BIE = 1. That means that buffer[5] = 0xA9
  7. Set reg 0x3E (data class) to 82
  8. Set reg 0x3F (data block) to 0
  9. Set reg 0x61 (block data cntl) to 0
  10. Write 32 bytes of data to register 0x40 and onwards from buffer
  11. Calculate new checksum (0x34) and write it to reg 0x60

If I then read out the buffer the new value is not stored. What am I doing wrong?

Any help appreciated.

Best Regards,

Ulrich


Viewing all articles
Browse latest Browse all 80965

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>