I am trying to communicate to BQ24259 through I2C using PIC16LF1554. The 7th register of the device has a bit which can be used to turn off the battery. I used Mplab's MCC to configure the I2C settings. Using the example code in header files i wrote a similar function.
here is the relevant snippet of the code
Problems whilst using MPLAB's MCC to configure and use I2C and ADC
here is the relevant snippet of the code
Code (Text):
- #define RETRY_MAX 100
- #define ON 0x4B //register 7 toggle 5th bit to turn ON/OFF
- #define OFF 0x6B
- I2C_MESSAGE_STATUS status;...