CRC Data In Register CRCDI
Data In
8-bit or 16-bit
Byte MUX
8
CRC Initialization and Result Register
CRCINIRES
8
8
16
Write to CRCINIRES
16
CRC Checksum Generation
430
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
CRC Module
Figure 15-2. Implementation of CRC-CCITT Using the CRCDI and CRCINIRES Registers
15.3.2 Assembler Examples
demonstrates the operation of the on-chip CRC.
Example 15-1. General Assembler Example
...
PUSH
R4
; Save registers
PUSH
R5
MOV
#StartAddress,R4
; StartAddress < EndAddress
MOV
#EndAddress,R5
MOV
&INIT, &CRCINIRES
; INIT to CRCINIRES
L1 MOV
@R4+,&CRCDI
; Item to Data In register
CMP
R5,R4
; End address reached?
JLO
L1
; No
MOV
&Check_Sum,&CRCDI
; Yes, Include checksum
TST
&CRCINIRES
; Result = 0?
JNZ
CRC_ERROR
; No, CRCRES <> 0: error
...
; Yes, CRCRES=0:
; information ok.
POP
R5
; Restore registers
POP
R4
The details of the implemented CRC algorithm are shown by the data sequences in
using
word or byte accesses and the CRC data-in as well as the CRC data-in reverse byte registers.