Hello All,
I'm using CC3220MODASF to interface with the BQ32002. In the datasheet I came across the following in the Read Mode for the RTC
I'm passing my arguments for I2C Transaction API like this
txBufferRtc[0] = YEAR; // txBufferRtc[1] = MONTH; // txBufferRtc[2] = YEAR; i2cTransactionRTC.slaveAddress = RTC_ADDRESS; //0x68 i2cTransactionRTC.writeBuf = txBufferRtc; i2cTransactionRTC.writeCount = 1;//sizeof(txBufferRtc); i2cTransactionRTC.readBuf = rxBufferRtc; i2cTransactionRTC.readCount = sizeof(rxBufferRtc); //10 for (i = 0; i < 20; i++) { // I2C_transfer(i2c,&i2cTransactionEEPROM); I2C_transfer(i2c,&i2cTransactionRTC); // resistance = (rxBufferDPot[0]*1000000/256) + 60; /* Sleep for 1 second */ sleep(1); } /* Deinitialized I2C */ I2C_close(i2c);
Supposing I'm trying to read the YEAR, I've input the appropriate register after the slave address i.e. 0x06. However, I'm not getting any value (0 in the output). In this Read mode does it mean that after the slave address and the sub address, we have to again generate a start condition and slave address before we read from the register?
This is very confusing indeed. Please help
BR
Shubhankar