This is a translation for another basic compiler:
Function crc_dattalo(crc As Byte, crc_data As Byte) As Byte
Code:
'dattalo's CRC-8 Function
'(328_Tcy / 41.0_us)
Dim i As Byte
i = crc_data Xor crc
i = i And 0xff
crc = 0
If i.0 = 1 Then
crc = crc Xor 0x5e
Endif
If i.1 = 1 Then
crc = crc Xor 0xbc
Endif
If i.2 = 1 Then
crc = crc Xor 0x61
Endif
If i.3 = 1 Then
crc = crc Xor 0xc2
Endif
If i.4 = 1 Then
crc = crc Xor 0x9d
Endif
If i.5 = 1 Then
crc = crc Xor 0x23
Endif
If i.6 = 1 Then
crc = crc Xor 0x46
Endif
If i.7 = 1 Then
crc = crc Xor 0x8c
Endif
crc_dattalo = crc
End Function
Some additional info and comparison between three different approaches: http://www.ccsinfo.com/forum/viewtop...015&highlight=
Bookmarks