Thread: CRC problem

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    56

    CRC problem

    I am trying to compare a CRC from my file with the CRC taken from the serial port. The problem is that when I change code in my software, sometimes the CRC doesn't match each other. Can anyone help me?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I've use my psychic powers to determine where the problem in your code is. Now you can use your psychic powers to figure out what changes I'm suggesting.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    56
    I just wanna know what could be the reasoning behind this. If I comment a useless function, I get mismatched CRC. Are there any latest information on CRC on the web that I can check out?

  4. #4
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  5. #5
    Registered User
    Join Date
    Jul 2005
    Posts
    56
    Thanks Dave

  6. #6
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    You really should attempt to post as much detail as possible about your problem. But anyway, I'll take a shot in the dark on this one since I had a similiar problem with a RS-232 device.

    My problem was a timing issue with the RS-232 port. I was writing an application to communicate with a security/automation controller via the serial port. The controller required me to wait a full second prior to querying the port for the first time and thereafter I had to wait 50 milliseconds to read each additional char on the port. If I waited a little longer than the stated time, the app would sometimes hang or I would miss a transmitted character. Obviously, missing a character would cause inaccurate CRC calculations for me. Timing issue may be a problem for you if you're in a loop calling other functions and querying the RS-232 port.

    As I said before this is just a shot in the dark.

    Check out http://zorc.breitbandkatze.de/crc.html

    Bob

  7. #7
    Registered User
    Join Date
    Jul 2005
    Posts
    56
    I have been seen some CRC look up tables that are 16 bit and others that are two 8 bit tables which is basically the 16 bit table broken down. Can you tell me why they do this and which way is better? Also, if you can, can you lead me to the website that explains more about this?

    Thanks
    Last edited by NewGuy100; 09-12-2005 at 07:55 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM