SDAA287 March 2026 ADS112C04 , ADS112U04 , ADS114S06 , ADS114S08 , ADS122C04 , ADS122U04 , ADS124S06 , ADS124S08 , ADS125H01 , ADS125H02 , ADS1260 , ADS1261 , ADS1262 , ADS1263 , ADS127L01 , ADS127L11 , ADS127L14 , ADS127L18 , ADS127L21 , ADS131A02 , ADS131A04 , ADS131M02 , ADS131M02-Q1 , ADS131M03 , ADS131M03-Q1 , ADS131M04 , ADS131M04-Q1 , ADS131M06 , ADS131M06-Q1 , ADS131M08 , ADS131M08-Q1 , ADS7028 , ADS7038 , ADS7066 , ADS7067 , ADS7128 , ADS7138 , AFE78101 , AFE781H1 , AFE78201 , AFE782H1 , AFE88101 , AFE881H1 , AFE88201 , AFE882H1 , DAC60504 , DAC60508 , DAC61401 , DAC61402 , DAC61404 , DAC61408 , DAC61416 , DAC70504 , DAC70508 , DAC71408 , DAC71416 , DAC7750 , DAC7760 , DAC80504 , DAC80508 , DAC81401 , DAC81402 , DAC81404 , DAC81408 , DAC81416 , DAC8741H , DAC8742H , DAC8750 , DAC8760 , DAC8771 , DAC8775 , HDC3020 , HDC3020-Q1 , HDC3021 , HDC3021-Q1 , HDC3022 , HDC3022-Q1 , LMP90077 , LMP90078 , LMP90079 , LMP90080 , LMP90097 , LMP90098 , LMP90099 , LMP90100 , TMAG5173-Q1 , TMP114 , TMP126 , TMP126-Q1 , TMP1826 , TMP1827
The polynomial can also be easily
changed in the script. For example, the original crc8CCITTZeroes()
example has the if statement for the CRC polynomial shown in Figure 2-8.
The 0x07 in the XOR is the polynomial and represents the bottom three terms of x8 + x2 + x + 1. The x8 term is the MSB that triggers the XOR.
If the algorithm is changed to
CRC-8-One-Wire, a new x8 + x5 + x4 + 1 polynomial
is represented by 0x31 and the initial value is 0xFF. Renaming the function, start
the crc8OneWireOnes() function with the same crc = 0xFF at
the beginning. Change the polynomial calculation with a new XOR as shown in Figure 2-9.
Details of the CRC-8-One-Wire algorithm are listed in Table 2-6.
| CRC | Polynomial | Initial Value | Devices | CRC for 0xABC123 |
|---|---|---|---|---|
| CRC-8-One-Wire | x8 + x5 + x4 + 1 (0x31) | 0xFF | LMP9007x, LMP90080, LMP9009x, LMP90100, HDC302x, HDC302x-Q1 | 0xF4 |
Again, when making changes to the JavaScript, also change in the body text describing the CRC function. Then change the calculateCRC() function to call the new CRC calculation. The resulting CRC-8-One-Wire calculation appears in the browser window as shown in Figure 2-10.
Figure 2-10 CRC Result for 0xABC123,
CRC-8-OneWire, Initial Value 0xFF