I am trying to interface the SparkFun LiPo Fuel Gauge (www.sparkfun.com/.../10617) to my F28069 Launchpad and I am having trouble reading the 16-bit SOC result calculated by ModelGauge algorithm. I have copied and pasted my code and attached a screenshot of my I2C bus below.
unsigned char FuelGaugeMSB = 0; unsigned char FuelGaugeLSB = 0; I2caRegs.I2CSAR = 0x36; //0x6C, Write MAX I2caRegs.I2CCNT = 1; I2caRegs.I2CDXR = 0x04; //0x04, SOC Register I2caRegs.I2CMDR.all = 0x2620; while(!I2caRegs.I2CSTR.bit.ARDY); I2caRegs.I2CCNT = 1; I2caRegs.I2CMDR.all = 0x2C20; while(!I2caRegs.I2CSTR.bit.RRDY); FuelGaugeMSB = I2caRegs.I2CDRR; while(!I2caRegs.I2CSTR.bit.RRDY); FuelGaugeLSB = I2caRegs.I2CDRR; return FuelGaugeMSB;