| поискавой системы для электроныых деталей |
|
CFA633-RDI-KS датащи(PDF) 74 Page - Crystalfontz America, Inc. |
|
|
|||||||||||||||||||||||||||||
CFA633-RDI-KS датащи(HTML) 74 Page - Crystalfontz America, Inc. |
|
74 / 88 page ![]() Crystalfontz America, Inc. Data Sheet Release Date 2012/02/21 www.crystalfontz.com CFA633-RDI-KS LCD Module (Hardware v2.0 / Firmware s2v1) February 2012 Page 74 Algorithm 2B: “C” Improved Bit Shift Implementation This is a simplified algorithm that implements the CRC. unsigned short get_crc(unsigned char count,unsigned char *ptr) { unsigned short crc; //Calculated CRC unsigned char i; //Loop count, bits in byte unsigned char data; //Current byte being shifted crc = 0xFFFF; // Preset to all 1's, prevent loss of leading zeros while(count--) { data = *ptr++; i = 8; do { if((crc ^ data) & 0x01) { crc >>= 1; crc ^= 0x8408; } else crc >>= 1; data >>= 1; } while(--i != 0); } return (~crc); } Algorithm 3: “PIC Assembly” Bit Shift Implementation This routine was graciously donated by one of our customers. ;==================================================================== ; Crystalfontz CFA633 PIC CRC Calculation Example ; ; This example calculates the CRC for the hard coded example provided ; in the documentation. ; ; It uses "This is a test. " as input and calculates the proper CRC ; of 0x93FA. ;==================================================================== #include "p16f877.inc" ;==================================================================== ; CRC16 equates and storage ;-------------------------------------------------------------------- accuml equ 40h ; BYTE - CRC result register high byte accumh equ 41h ; BYTE - CRC result register high low byte datareg equ 42h ; BYTE - data register for shift j equ 43h ; BYTE - bit counter for CRC 16 routine Zero equ 44h ; BYTE - storage for string memory read |
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |