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 previous browser-based example takes in a hex string of bytes entered through the browser running an HTML file. The script converts the hex string into an array of bytes. The script makes the calculation for CRC-8-CCITT with a 0x00 initial value and reports the result in the browser. The code processes the input as bytes, so the input must be an even number of hex characters.
The HTML main body section starts with a box to enter in a hex string with a default input of ABC123. The body section also creates the Calculate CRC button to generate the CRC. Two text lines describe the CRC, showing the generator polynomial and the initial value used for the calculation. The result is displayed on the bottom line.
Table 2-1 lists the relevant functions of the JavaScript code from the example.
| Function | Description |
|---|---|
| calculateCRC() | Pulls in the text from the input box and verifies that the input has only hex characters, calls hexToBytes() and crc8CCITTZeroes() |
| hexToBytes() | Converts the input characters to an array of bytes |
| crc8CCITTZeroes() | Calculates CRC-8-CCITT with a zero initial value from the array created from hexToBytes() |
The example calculates CRC-8-CCITT using 0x00 as an initial value. The CRC-8-CCITTZeroes() function is taken out of the example and shown in the following code in Figure 2-5.
The initial value is defined in the first line of the function. This CRC uses a polynomial of x8 + x2 + x + 1 represented as 0x07 in crc8CCITTZeroes(). The polynomial is set up in the bitwise XOR (indicated by the “^”) with the CRC value shown in the code snippet below.
Details of CRC-8-CCITT are described in Table 2-6.
| CRC | Polynomial | Initial Value | Devices | CRC for 0xABC123 |
|---|---|---|---|---|
| CRC-8-CCITT | x8 + x2 + x + 1 (0x07) | 0x00 | AFE881H1, AFE882H1, AFE88101, AFE88201, DAC8741H, DAC8742H, DAC8750, DAC8760, DAC8771, DAC8775, DAC80504, DAC80508, DAC81401, DAC81402, DAC81404, DAC81408, DAC81416, ADS124S08, ADS125H02, ADS1263, ADS127L01, ADS7028, ADS7038, ADS7128, ADS7138 | 0xB5 |
The polynomial and initial values are shown and TI devices that use this specific CRC are listed as well. The last column also shows the result of a CRC calculation using ABC123 using this CRC function. The resulting value can be used to check the code for the CRC.