Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] CRC check Function calculation

Status
Not open for further replies.

ajit_nayak87

Member level 5
Joined
Oct 30, 2017
Messages
86
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
981
I found 8 bit CRC calculation for PIC controller

I would like to how to select poly = 0xa001; value.
I undestand remaining part not Below part.
I downloaded CRC calcualtion for excel using SimplyModubus . I have attached link for reference.


Code:
unsigned int crc_fn(unsigned char *dpacket,unsigned int len)	 // CRC Function(Error calcualtion)
{
	unsigned int crc = 0xffff,poly = 0xa001;
	unsigned int i=0,j=0; 
			
	for(i=0;i<len;i++)
	{
	   crc^= dpacket[i];
	   for(j=0;j<8;j++)
	   {
		   if(crc & 0x01)
		   {
			   crc >>= 1;
			   crc ^= poly;
		   }
		   else
				crc >>= 1;
	   }
	}
	return (crc);	  
}
 

I would like to how to select poly = 0xa001

You are not posing any specific question at all. By the way, there are some standardized CRC polynomials and you cannot select any other which do not meet requirements.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top