CRC Checksum Generation
431
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
CRC Module
Example 15-2. Reference Data Sequence
...
mov
#0FFFFh,&CRCINIRES
; initialize CRC
mov.b
#00031h,&CRCDI_L
; "1"
mov.b
#00032h,&CRCDI_L
; "2"
mov.b
#00033h,&CRCDI_L
; "3"
mov.b
#00034h,&CRCDI_L
; "4"
mov.b
#00035h,&CRCDI_L
; "5"
mov.b
#00036h,&CRCDI_L
; "6"
mov.b
#00037h,&CRCDI_L
; "7"
mov.b
#00038h,&CRCDI_L
; "8"
mov.b
#00039h,&CRCDI_L
; "9"
cmp
#089F6h,&CRCINIRES
; compare result
; CRCRESR contains 06F91h
jeq
&Success
; no error
br
&Error
; to error handler
mov
#0FFFFh,&CRCINIRES
; initialize CRC
mov.w
#03231h,&CRCDI
; "1" & "2"
mov.w
#03433h,&CRCDI
; "3" & "4"
mov.w
#03635h,&CRCDI
; "5" & "6"
mov.w
#03837h,&CRCDI
; "7" & "8"
mov.b
#039h,
&CRCDI_L
; "9"
cmp
#089F6h,&CRCINIRES
; compare result
; CRCRESR contains 06F91h
jeq
&Success
; no error
br
&Error
; to error handler
...
mov
#0FFFFh,&CRCINIRES
; initialize CRC
mov.b
#00031h,&CRCDIRB_L
; "1"
mov.b
#00032h,&CRCDIRB_L
; "2"
mov.b
#00033h,&CRCDIRB_L
; "3"
mov.b
#00034h,&CRCDIRB_L
; "4"
mov.b
#00035h,&CRCDIRB_L
; "5"
mov.b
#00036h,&CRCDIRB_L
; "6"
mov.b
#00037h,&CRCDIRB_L
; "7"
mov.b
#00038h,&CRCDIRB_L
; "8"
mov.b
#00039h,&CRCDIRB_L
; "9"
cmp
#029B1h,&CRCINIRES
; compare result
; CRCRESR contains 08D94h
jeq
&Success
; no error
br
&Error
; to error handler
...
mov
#0FFFFh,&CRCINIRES
; initialize CRC
mov.w
#03231h,&CRCDIRB
; "1" & "2"
mov.w
#03433h,&CRCDIRB
; "3" & "4"
mov.w
#03635h,&CRCDIRB
; "5" & "6"
mov.w
#03837h,&CRCDIRB
; "7" & "8"
mov.b
#039h,
&CRCDIRB_L
; "9"
cmp
#029B1h,&CRCINIRES
; compare result
; CRCRESR contains 08D94h
jeq
&Success
; no error
br
&Error
; to error handler