EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

CRC_CCITT 16-bit assembly language code

Started by Vy October 24, 2007
Is there someone who has access to the CRC_CCITT 16-bit code written in
ARM7 assembly language?

I'm well aware that there's a ton of code in C for the same.

What's funny is i can do the CRC calculation by hand and have also
developed the algorithm but i'm unable to get the code up and running.

I'd be happy to share the code that i wrote. If you can help me kindly
send me an e-mail at vywack@yahoo.com or we can settle it on this forum.

Thanks a ton

Vy
Vy wrote:
> Is there someone who has access to the CRC_CCITT 16-bit code written in > ARM7 assembly language? > > I'm well aware that there's a ton of code in C for the same. > > What's funny is i can do the CRC calculation by hand and have also > developed the algorithm but i'm unable to get the code up and running.
Just a wild-assed guess, are you remembering to "flush" the crc routine with zeros at the end?
> I'd be happy to share the code that i wrote. If you can help me kindly > send me an e-mail at vywack@yahoo.com or we can settle it on this forum. > > Thanks a ton > > Vy
>Vy wrote: >> Is there someone who has access to the CRC_CCITT 16-bit code written
in
>> ARM7 assembly language? >> >> I'm well aware that there's a ton of code in C for the same. >> >> What's funny is i can do the CRC calculation by hand and have also >> developed the algorithm but i'm unable to get the code up and running. > >Just a wild-assed guess, are you remembering >to "flush" the crc routine with zeros at the >end? > >> I'd be happy to share the code that i wrote. If you can help me kindly >> send me an e-mail at vywack@yahoo.com or we can settle it on this
forum.
>> >> Thanks a ton >> >> Vy
Here's the detail...for more detail check out the paper by Mr Ross Williams The initial value is 0x1d0f The Poly is 0x1021 which is actually 1 0001 0000 0010 0001 The width is 16 so 16 zeroes are appended to the message for example the message is 41h - 0100 0001 poly= ------------------------------------------ 10001000000100001 ) 1111111111111111010000010000000000000000 my problem is how do i position the 17 bits (Poly) within a 32 bit register. Do i keep it at the far right (towards MSB)? thanks Vy
On Oct 25, 1:37 am, "Vy" <vyw...@yahoo.com> wrote:
> Is there someone who has access to the CRC_CCITT 16-bit code written in > ARM7 assembly language? > > I'm well aware that there's a ton of code in C for the same. > > What's funny is i can do the CRC calculation by hand and have also > developed the algorithm but i'm unable to get the code up and running. >
Will the below link help you ? http://8052.com/codelib/CRC_16.asm Try looking at the Linux implementation w.r.t this on ARM . I think, the ARM CRC routines should be in assembly and they may help you. Karthik Balaguru
"Vy" <vywack@yahoo.com> wrote in message news:pIKdnXCiGNCbMILanZ2dnUVZ_sytnZ2d@giganews.com...
> Is there someone who has access to the CRC_CCITT 16-bit code written in > ARM7 assembly language? > > I'm well aware that there's a ton of code in C for the same. > > What's funny is i can do the CRC calculation by hand and have also > developed the algorithm but i'm unable to get the code up and running.
How about starting with a working C implementation and optimise it? After that you will realise that it isn't possible to do any better in assembler... A good implementation needs about 4-5 instructions for every 8 input bits. Wilco
Vy wrote:
> Is there someone who has access to the CRC_CCITT 16-bit code written in > ARM7 assembly language? > > I'm well aware that there's a ton of code in C for the same. > > What's funny is i can do the CRC calculation by hand and have also > developed the algorithm but i'm unable to get the code up and running. > > I'd be happy to share the code that i wrote. If you can help me kindly > send me an e-mail at vywack@yahoo.com or we can settle it on this forum.
1) How does the data come in: a) by octet (byte) or by bit? 2) Study project / homework? For the CRC_CCITT there are at least 3 ways to implement: - 1 bit at a time - 4 bits at a time - 8 bits (1 byte/octet) at a time -- Tauno Voipio tauno voipio (at) iki fi
On Wed, 24 Oct 2007 15:37:26 -0500, "Vy" <vywack@yahoo.com> wrote:

>Is there someone who has access to the CRC_CCITT 16-bit code written in >ARM7 assembly language? > >I'm well aware that there's a ton of code in C for the same. > >What's funny is i can do the CRC calculation by hand and have also >developed the algorithm but i'm unable to get the code up and running. > >I'd be happy to share the code that i wrote. If you can help me kindly >send me an e-mail at vywack@yahoo.com or we can settle it on this forum. >
Here is some ARM assembly code for implimenting CRC-CCITT. http://homepages.tesco.net/~rainstorm/crc-catalogue.htm Regards Anton Erasmus
>Vy wrote: >> Is there someone who has access to the CRC_CCITT 16-bit code written
in
>> ARM7 assembly language? >> >> I'm well aware that there's a ton of code in C for the same. >> >> What's funny is i can do the CRC calculation by hand and have also >> developed the algorithm but i'm unable to get the code up and running. >> >> I'd be happy to share the code that i wrote. If you can help me kindly >> send me an e-mail at vywack@yahoo.com or we can settle it on this
forum.
> >1) How does the data come in: a) by octet (byte) or by bit? > >2) Study project / homework? > >For the CRC_CCITT there are at least 3 ways to implement: > > - 1 bit at a time > - 4 bits at a time > - 8 bits (1 byte/octet) at a time > >-- > >Tauno Voipio >tauno voipio (at) iki fi > >
the data could come in anywhere from a byte to a word (32bits) to several words. The words are broken down into bytes. The byte is broken down to bits to feed it to the CRC, check if the topmost bit is 1, if yes XOR it if not get the next bit in. i'm working with a Fujitsu MC that uses SPI to talk to the host. An SPI is a very simple protocol with no CRCs and ACKs but they have added their own pyrotchnics to included CRC checking and ACK at the end of evey stream of message. thanks for the input Tauno
>On Wed, 24 Oct 2007 15:37:26 -0500, "Vy" <vywack@yahoo.com> wrote: > >>Is there someone who has access to the CRC_CCITT 16-bit code written in >>ARM7 assembly language? >> >>I'm well aware that there's a ton of code in C for the same. >> >>What's funny is i can do the CRC calculation by hand and have also >>developed the algorithm but i'm unable to get the code up and running. >> >>I'd be happy to share the code that i wrote. If you can help me kindly >>send me an e-mail at vywack@yahoo.com or we can settle it on this
forum.
>> > >Here is some ARM assembly code for implimenting CRC-CCITT. >http://homepages.tesco.net/~rainstorm/crc-catalogue.htm > >Regards > Anton Erasmus >
Hi Anton, I already went through that code. It's not right. I'm using ARM7 and ARM7 does not have instructions like ASL. It only has LSL. Also the person uses $ signs in front of hex numbers which i can't figure out why. Maybe an older version of ARM supported all that but with ARM7 none of that exists. THanks Anton
On Fri, 26 Oct 2007 02:27:06 -0500, "Vy" <vywack@yahoo.com> wrote:

>>On Wed, 24 Oct 2007 15:37:26 -0500, "Vy" <vywack@yahoo.com> wrote: >> >>>Is there someone who has access to the CRC_CCITT 16-bit code written in >>>ARM7 assembly language? >>> >>>I'm well aware that there's a ton of code in C for the same. >>> >>>What's funny is i can do the CRC calculation by hand and have also >>>developed the algorithm but i'm unable to get the code up and running. >>> >>>I'd be happy to share the code that i wrote. If you can help me kindly >>>send me an e-mail at vywack@yahoo.com or we can settle it on this >forum. >>> >> >>Here is some ARM assembly code for implimenting CRC-CCITT. >>http://homepages.tesco.net/~rainstorm/crc-catalogue.htm >> >>Regards >> Anton Erasmus >> >Hi Anton, > >I already went through that code. It's not right. I'm using ARM7 and ARM7 >does not have instructions like ASL. It only has LSL. >Also the person uses $ signs in front of hex numbers which i can't figure >out why. > >Maybe an older version of ARM supported all that but with ARM7 none of >that exists.
LSL and ASL are the same thing. The assembler used, probably has a few pseudo instructions to help with readability. Regards Anton Erasmus

The 2024 Embedded Online Conference