qt60326 Quantum Research Group, qt60326 Datasheet - Page 29

no-image

qt60326

Manufacturer Part Number
qt60326
Description
32 & 48 Key Qmatrix Ics
Manufacturer
Quantum Research Group
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
qt60326-ASG
Manufacturer:
Rohm
Quantity:
4 982
7 Appendix
7.1 8-Bit CRC Software C Algorithm
// 8 bits crc calculation. Initial crc entry value must be 0.
// polynomial = X8 + X5 + X4 + 1
// data is an 8 bit number;
// repeat this function for each data block byte, folding the result
//
unsigned char eight_bit_crc(unsigned char crc, unsigned char data)
{ unsigned char index;
return crc;
}
7.2 16-Bit CRC Software C Algorithm
// 16 bits crc calculation. Initial crc entry value must be 0.
// The message is not augmented with 'zero' bits.
// polynomial = X16 + X12 + X5 + 1
// data is an 8 bit number, unsigned
// crc is a 16 bit number, unsigned
// repeat this function for each data block byte, folding the result
//
unsigned long sixteen_bit_crc(unsigned long crc, unsigned char data)
{ unsigned char index;
}
A CRC calculator for Windows is available free of charge from Quantum Research.
)
unsigned char fb;
index = 8;
do
{ fb = (crc ^ data) & 0x01;
} while(--index);
crc ^= (unsigned long)(data) << 8;
index = 8;
do
{ if(crc & 0x8000)
} while(--index);
return crc;
back into the call parameter crc
back into the call parameter crc
data >>= 1;
crc >>= 1;
if(fb)
{ crc ^= 0x8c;
}
{ crc= (crc << 1) ^ 0x1021;
}
else
{ crc= crc << 1;
}
// shift counter
// intermediate test bit
// initialize the shift counter
// loop 8 times
// shift counter
// loop 8 times
crc is an unsigned 8 bit number
29
QT60486-AS R8.01/0105

Related parts for qt60326