SLUA475 November 2016 BQ2060A , BQ20Z80 , BQ40Z50-R1 , BQ40Z50-R2 , BQ40Z60 , BQ78350-R1 , BQ78350-R1A
PEC calculations take some resources by the host system unless it has a hardware PEC engine. Although this document does not detail about how to do these calculations, many resources are available on the Internet, which include explanations and even code examples. Do an Internet search for PEC or CRC-8 computation. 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.
Consider the use of a logic analyzer or bus snooper for PEC calculations. Though a logic analyzer or a bus snooper may appear to be the simplest tools to monitor the SMBus traces, the following are a few of many reasons why an oscilloscope is preferable.
Msg 11 [S]#16 [A] #0E [A][S] #17 [A] #8C [A] #86 [A] #D8 [N][P]
Msg 12 [S]#16 [A] #0E [A][S] #17 [N]
It is apparent that this communication has a problem: the device NACKed its device address after the repeated start.