For an example of an online calculator that can check your code, refer to http://smbus.org/faq/crc8Applet.htm. The following are two primary methods to calculate a PEC for a given data packet. Depending on your host CPU and memory, one of these methods should work for your application...
PECByte is calculated with CRC8 and is based on every preceding byte in the packet. The address byte used for the calculation includes write bit, so 0x16. There is an online calculator herehttp://www.sunshine2k.de/coding/javascript/crc/crc_js.htmland an example ...
After determining the range of charging voltage of the gauge, 16.7kΩ resistor is chosen for RBOTTOM to cover 23.97V to 24.96V (3.995/cell to 4.16/cell) following the BQ25756 Design Calculator. If the range requested by the gauge is below the minimum value, then set to the lowest ...