This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CRC-32 or CRC-16 code

Dear friends,

I'm trying to develop a CRC-32 routine for my V-Star Quisar 320 using the Keil C51 compiler suite. I have found (in the Internet) a sample C code implementing CRC-32 algorithm.

Testing this code in Turbo C (for DOS) and in Visual Basic (after the addequate porting), it runs perfectly. The same Turbo C code compiled and downloaded to Quisar 320 does not produce the same result as in PC.

What can I do to make my code run and produce the correct result in Quisar 320? Someone knows a CRC routine specific to this model of machine?

Thanks,
Mauricio Harley

Parents
  • When you say, "addequate porting" are you sure?
    Remember that the PC has a different word size and different byte ordering.

    The fact that you have 2 working PC versions, but the embedded version fails, suggests that you have an unsafe dependency on the PC architecture.

    Check the thread, "onversion (sic) 8/16 bit types problem"
    http://www.keil.com/forum/msgpage.asp?MsgID=1109
    Including the link to Mark Odell's site, which gives some platform-independence tips.

    The use of unions to access individual bytes of 16- or 32-bit words is particularly non-portable; eg, see Keil Knowledgebase article http://www.keil.com/support/docs/1279.htm

    (I'll collect my comission later, Mark!)

Reply
  • When you say, "addequate porting" are you sure?
    Remember that the PC has a different word size and different byte ordering.

    The fact that you have 2 working PC versions, but the embedded version fails, suggests that you have an unsafe dependency on the PC architecture.

    Check the thread, "onversion (sic) 8/16 bit types problem"
    http://www.keil.com/forum/msgpage.asp?MsgID=1109
    Including the link to Mark Odell's site, which gives some platform-independence tips.

    The use of unions to access individual bytes of 16- or 32-bit words is particularly non-portable; eg, see Keil Knowledgebase article http://www.keil.com/support/docs/1279.htm

    (I'll collect my comission later, Mark!)

Children