Quantcast
Channel: Power management forum - Recent Threads
Viewing all articles
Browse latest Browse all 35901

BQ27510: Reading Operation Configuration Register

$
0
0

For some reason I can't get following simple implementation to work.

    // read BQ27510 Operation Configuration Register

         for (i = 0; i < BQ2710_DFFS_BLOCK_SIZE; i++) data[i] = 0x00;
    data[0] = 0x00;
    result = I2C_write(0xAA, 0x61, data, 1); //0x61 0x00 cmd=BlockDataControl(), data=0x00
    delay_us(66); // 66 us delay

    data[0] = 64;
    result = I2C_write(0xAA, 0x3E, data, 1); //0x3E 0x40 cmd=DataFlashClass(), data=64
    delay_us(66);

    data[0] = 0x00;
    result = I2C_write(0xAA, 0x3F, data, 1); //0x3F 0x00 cmd=DataFlashBlock(), data=0x00
    delay_us(66);

    result = I2C_read(0xAA, 0x40, 0, 0, data, 32); //0x40 BlockData()

    // low level I2C routine takes care of setting address bit0 to 1

read data contains 0x7E 0x2E 0x31 0x2E 0x30 0x30 0x2D 0x00... which is in ASCII "~.1.00." These chars are part of the ManufacturerInfoBlockA which conatains string "v.1.00-20110907". Entering the same sequence in bqEasy/I2C Pro gives reasonable result (0x09 0x79...). Two first bytes are the same if I read only two bytes which should contain the register contents.

IC is in full access mode (not SEALED) and my functions I2C_write()/I2C_read() work otherwise OK i.e. I can write and read standard commands as well as For ex. ManufacturerInfoBlockA. Obviously I am doing something wrong but can somebody point out how to proceed...


Viewing all articles
Browse latest Browse all 35901

Trending Articles



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