8 Appendix - CRC Algorithms
8.1 8-Bit CRC Software C Algorithm
// 8 bits crc calculation. Initial value is 0
// polynomial = X
8
+ X
5
+ X
4
+ 1
// data is an 8 bit number; crc is a 8 bit number
int eight_bit_crc(int crc, int data)
{ int index; // shift counter
int fb;
index = 8; // initialise the shift counter
do
{ fb = (crc ^ data) & 0x01;
data >>= 1;
crc >>= 1;
If(fb)
{ crc ^= 0x8c;
}
} while(--index);
return crc;
}
8.2 16-Bit CRC Software C Algorithm
// 16 bits crc calculation. Initial value is 0
// polynomial = X
16
+ X
12
+ X
5
+ 1
// data is an 8 bit number
// crc is a 16 bit number
long sixteen_bit_crc(long crc, int data)
{ int index; // shift counter
short fb;
crc ^= long(data) << 8;
index = 8;
do
{ if(crc & 0x8000)
{ crc= (crc << 1) ^ 0x1021;
}
else
{ crc= crc << 1;
}
}while(--index);
return crc;
}
A CRC calculator for Windows is available free of charge from Quantum Research.
lQ
22 QT60486-AS 0.07/1103
Advanced information; subject to change
lQ
Copyright © 2003 QRG Ltd. All rights reserved
Patented and patents pending
Corporate Headquarters
1 Mitchell Point
Ensign Way, Hamble SO31 4RF
Great Britain
Tel: +44 (0)23 8056 5600 Fax: +44 (0)23 8045 3939
admin@qprox.com
www.qprox.com
North America
651 Holiday Drive Bldg. 5 / 300
Pittsburgh, PA 15220 USA
Tel: 412-391-7367 Fax: 412-291-1015
The specifications set out in this document are subject to change without notice. All products sold and services supplied by QRG are
subject to our Terms and Conditions of sale and supply of services which are available online at www.qprox.com and are supplied with
every order acknowledgement. QProx, QTouch, QMatrix, QLevel, and QSlide are trademarks of QRG. QRG products are not suitable for
medical (including lifesaving equipment), safety or mission critical applications or other similar purposes. Except as expressly set out in
QRG's Terms and Conditions, no licenses to patents or other intellectual property of QRG (express or implied) are granted by QRG in
connection with the sale of QRG products or provision of QRG services. QRG will not be liable for customer product design and
customers are entirely responsible for their products and applications which incorporate QRG's products.

QT60326-AS

Mfr. #:
Manufacturer:
Description:
SENSOR IC MTRX TOUCH32KEY 44TQFP
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet