• AVR Freaks

Helpful ReplyHot!How to make CRC code

Author
parkcoding
Senior Member
  • Total Posts : 143
  • Reward points : 0
  • Joined: 2019/03/13 16:17:10
  • Location: 0
  • Status: offline
2020/02/16 21:24:54 (permalink)
0

How to make CRC code

Hi~
 
Im trying to make CRC code....:)
 
In data sheet,
 
CRC initial seed is 0x9C and CRC polynimial is x^8 + x^5 +x^4 + x^3 + 1.
 
But it is truly difficult for me.
 
Can anyone tell me any clues to get started?
 
thx!
 
P.S no table for CRC... I just know how to calculate CRC
post edited by parkcoding - 2020/02/16 21:26:10
#1
NKurzman
A Guy on the Net
  • Total Posts : 18392
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: How to make CRC code 2020/02/16 21:37:34 (permalink)
+1 (1)
Did you google for CRC code? Yours appears to be an 8 bit CRC.
#2
parkcoding
Senior Member
  • Total Posts : 143
  • Reward points : 0
  • Joined: 2019/03/13 16:17:10
  • Location: 0
  • Status: offline
Re: How to make CRC code 2020/02/16 22:21:51 (permalink)
0
Hi Mr.NKurzman
 
I'm trying to make CRC for 32bit-SPI....
 
 
#3
NKurzman
A Guy on the Net
  • Total Posts : 18392
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: How to make CRC code 2020/02/17 00:30:53 (permalink)
+1 (1)
You polynomial appears to be for a CRC-8.

Did you Google?. You should find many examples of the common algorithm.
Without the tables if you choose.
#4
parkcoding
Senior Member
  • Total Posts : 143
  • Reward points : 0
  • Joined: 2019/03/13 16:17:10
  • Location: 0
  • Status: offline
Re: How to make CRC code 2020/02/17 02:06:05 (permalink)
0
okay
 
I will do that.
 
one small thing,
 
what's the different between CRC and CRC paranomial..?
 
what's the divisor among that...??
 
thx
 
Mr.NKurzman
post edited by parkcoding - 2020/02/17 02:12:27

Attached Image(s)

#5
pcbbc
Super Member
  • Total Posts : 1637
  • Reward points : 0
  • Joined: 2014/03/27 07:04:41
  • Location: 0
  • Status: offline
Re: How to make CRC code 2020/02/17 04:42:09 (permalink) ☄ Helpfulby parkcoding 2020/02/17 16:07:52
+1 (1)
CRC on it's own generally refers to the CRC value. So the output of the polynomial (assume paranomial is a typo) calculated over some data.
 
The CRC polynomial on the other hand describes mathematically how to actually calculate the CRC.
Sometimes it is expressed in the mathematical x^8 + x^5 +x^4 + x^3 + 1 form.
 
Elsewhere, for example in computer science, you may see it expressed as a hex value: 0x39
post edited by pcbbc - 2020/02/17 04:47:30
#6
1and0
Access is Denied
  • Total Posts : 10548
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: How to make CRC code 2020/02/17 05:07:58 (permalink) ☄ Helpfulby parkcoding 2020/02/17 16:07:57
+1 (1)
... and a value of 0x9C when it's reversed.
#7
ric
Super Member
  • Total Posts : 26082
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: How to make CRC code 2020/02/17 05:31:20 (permalink)
+3 (3)
Why do you jump head first into code when you don't understand the fundamentals of what you are trying to achieve?
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#8
parkcoding
Senior Member
  • Total Posts : 143
  • Reward points : 0
  • Joined: 2019/03/13 16:17:10
  • Location: 0
  • Status: offline
Re: How to make CRC code 2020/02/17 16:12:14 (permalink)
0
thx, Mr.pcbbc and Mr.1and0! :)
 
Im have to think about it. 
 
and Mr.ric,

I have been studied PIC alone.. haha
#9
parkcoding
Senior Member
  • Total Posts : 143
  • Reward points : 0
  • Joined: 2019/03/13 16:17:10
  • Location: 0
  • Status: offline
Re: How to make CRC code 2020/02/17 19:10:21 (permalink)
0
I did google and I found weird about it....?
 
Why should do bit-reverse before CRC..?
 
What purpose bir-reverse befor CRC?
 
THX everyone!
#10
dan1138
Super Member
  • Total Posts : 3388
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: How to make CRC code 2020/02/17 20:29:10 (permalink) ☄ Helpfulby parkcoding 2020/02/17 21:52:00
+1 (1)
@parkcoding,
 
Traditionally a CRC is a check "word" attached to a stream of data bits used to detect missing or altered bits in the data stream.
 
The notion of "forward" or "reverse" polynomial relates to how a controller constructs the bit stream, either Most-Significant-Bit first or Least-Significant-Bits first. In general the bit order is only important when the CRC is used to correct bits when an error is detected.
 
The number of bits in the CRC determine how many error bits can be detected, how large a span of consecutive bits can be detected and how many can be corrected over how large a field of data.
 
The types of errors that CRCs are best at detecting are burst errors. The size of a data field is selected so as to keep a likely error burst affects to just one field and as few bits as possible.
 
For most current implementation only the error detection quality of the CRC seems useful as the re-transmission of data has a low cost. For systems where the re-transmission cost is high the correction quality becomes of greater importance.
 
The spiral nature of the data track on audio CD and video DVD discs use this error correction feature of CRCs. When the data stream can be corrected more quickly in memory than repositioning the read head to re-read the data. Also the data used for audio and video playback does not need to be perfect. Small errors tend to go unnoticed by humans when the content is rendered in a timely fashion.
post edited by dan1138 - 2020/02/17 22:12:07
#11
dan1138
Super Member
  • Total Posts : 3388
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: How to make CRC code 2020/02/17 20:44:51 (permalink) ☄ Helpfulby parkcoding 2020/02/17 21:52:29
+1 (1)
ric
Why do you jump head first into code when you don't understand the fundamentals of what you are trying to achieve?



Homer J Simpson says: "Trying is the first step in failing."
Yoda says: "Do or do not. There is no try."
 
To understand the fundamentals of Galois fields and algebraic coding theory is not a subject popular with most engineering students. For me it was an elective and perhaps the hardest math I ever attempted. Calculus was a lot easier.
#12
rodims
Super Member
  • Total Posts : 1555
  • Reward points : 0
  • Joined: 2009/02/10 11:08:59
  • Location: 51.9627, 7.6262
  • Status: online
Re: How to make CRC code 2020/02/18 05:24:38 (permalink)
+1 (1)
#13
Jump to:
© 2020 APG vNext Commercial Version 4.5