Dallas CRC8 Routines


Results 1 to 24 of 24

Threaded View

  1. #14
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default Re: Dallas CRC8 Routines

    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=
    Last edited by languer; - 24th May 2012 at 06:15.

Similar Threads

  1. Problems with CRC8 Calc in 1Wire
    By JohnB in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th March 2007, 22:01
  2. dallas ibutton to pics
    By CBUK in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 25th October 2006, 12:55
  3. Dallas 1-wire search Routine
    By jimbab in forum Code Examples
    Replies: 0
    Last Post: - 7th April 2006, 16:14
  4. Dallas Semiconductor Components Serial Numbers
    By ideaman234 in forum General
    Replies: 2
    Last Post: - 27th February 2006, 22:17
  5. Dallas CRC16 Routines
    By Tom Estes in forum Code Examples
    Replies: 0
    Last Post: - 16th May 2005, 15:29

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts