Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Neil Kurzman
08/06/07 11:22
Read: 380 times
Ny
USA


 
#142823 - The formula
Responding to: John Myers's previous message
This is in VB6, but it translates well. and Make your own tables

Public Function CRC8Byte(ByVal Data As Byte, ByVal CRC As Byte) As Byte

Dim j As Integer
Dim k As Integer

Const POLY = &H107 'X8 + X2 + X1 + 1
'Const POLY = &H12F 'X8 + X5 + X3 + X2 + X1 + 1
'8 7654 3210
'1 0010 1111


j = (Data Xor CRC) And &HFF

For k = 1 To 8
If (j And &H80) Then
j = (j * 2) Xor POLY
Else
j = j * 2
End If
Next k



CRC8Byte = j And &HFF



List of 23 messages in thread
TopicAuthorDate
How to create a crc table?      John Myers      08/04/07 02:33      
   simple      Jan Waclawek      08/04/07 08:10      
      RE: simple      John Myers      08/04/07 15:34      
         I said it\'s simple      Jan Waclawek      08/04/07 17:33      
            Thank you      John Myers      08/04/07 18:27      
            Protocols      Andy Neil      08/06/07 07:48      
               examples      Jan Waclawek      08/06/07 08:05      
   Runtime Computed Table??      Michael Karas      08/04/07 09:14      
      RE: Runtime...?      John Myers      08/04/07 16:02      
      table is not necessary      Jan Waclawek      08/04/07 17:41      
         Benchmark      John Myers      08/04/07 18:16      
            I did benchmarks as such on AVR      Michael Karas      08/04/07 19:38      
               Similar findings      Russell Bull      08/04/07 21:05      
                  no beavers that I've tended to!!      Michael Karas      08/04/07 22:50      
               not bitwise....      Jan Waclawek      08/05/07 02:45      
            Better is a strong word      Neil Kurzman      08/05/07 21:19      
               Also comment about SMBus PEC Code...      Michael Karas      08/05/07 21:30      
   The Table      Neil Kurzman      08/06/07 11:19      
   The Nibble Table for Poly 107      Neil Kurzman      08/06/07 11:20      
   The formula      Neil Kurzman      08/06/07 11:22      
   Have you seen this?      Richard Erlacher      08/06/07 18:42      
      Now I have      Neil Kurzman      08/06/07 21:26      
      Yes, that is a Key Document!      Andy Neil      08/07/07 02:45      

Back to Subject List