电路设计,软件开发,专业项目团队承接电子产品开发!


ISPRO下载型编程器
火爆销售中

RS232/TTL转换器
全IC串口窃电

RS232/TTL转换线
全IC串口窃电

ByteBlasterMV Cable
CPLD/FPGA并口下载线

ByteBlaster II Cable ISPRO下载型编程器
支持S51/AVR/PIC
超级51开发板套件
前卫实用超值

PC/MCU/CPLD
三合一学习套件

全新万年历方案
AVR单片机开发板
 

Min51单片机仿真机
迷你型

ARM7开发板
仅售260元!
 

RS-232/RS-485双向接口电平转换器  

51单片机升级STM32
火爆销售中
MPLAB-ICD2
火爆销售中
LED51开发板
玩具又名图文显示棒

面板模块/开发板
经济危机明智决择

       

GSM MODEM GSM猫

SMS短信模块 工业级/全自动
火爆销售中

大功率数传电台

高速数传电台

您当前位置:电子技术资料 -> 外围驱动 -> CRC校验 ->

祝您阅读愉快!

ISPRO下载型编程器

RS232 TO TTL转换器
↑↑本文相关产品介绍↑↑

CRC16-STANDARD的快速算法51汇编


类别:技术文章
来源:未知
作者:未知
关键字:CRC
加入日期:2004-7-1

CRC16-STANDARD的快速算法51汇编

本人在赤壁车站的系统设计中就利用CRC16-STANDARD算法,以保证信息的真确发送,该系统采用了485半双工通讯本人在赤壁车站的系统设计中就利用CRC16-STANDARD算法,以保证信息的真确发送,该系统采用了485半双工通讯。效果很好!(注:CRC16算法包括有好几种算法,如:CRC16_STANDARD
,CRC16-NORMAL,大家小心了)
CRC16-STANDARD的快速算法
 
;入口: R0-原CRC结果高位 R1-原CRC结果低位R2-下个参与计算的字节值
;(最开始可设置R0=0,R1=0,R2=第一字节值)
;出口: R0-CRC结果高位 R1-CRC结果低位
 
影响:A,DPH,DPL
CRC16:
PUSH DPH
PUSH DPL
PUSH ACC
MOV A,R1
XRL A,R2
MOV DPH,#20h
MOV DPL,A
CLR A
MOVC A,@A+DPTR
XRL A,R0
MOV R1,A
INC DPH
CLR A
MOVC A,@A+DPTR
MOV R0,A
POP ACC
POP DPL
POP DPh
RET
NOP
NOP
LJMP MAIN
ORG 2000H ;(根据你的实际情况而定)
CRCTABLE:
DB
000H,0C1H,081H,040H,001H,0C0H,080H,041H,001H,0C0H,080H,041H,000H,0C1H,081H,040H
DB
001H,0C0H,080H,041H,000H,0C1H,081H,040H,000H,0C1H,081H,040H,001H,0C0H,080H,041H
DB
001H,0C0H,080H,041H,000H,0C1H,081H,040H,000H,0C1H,081H,040H,001H,0C0H,080H,041H
DB
000H,0C1H,081H,040H,001H,0C0H,080H,041H,001H,0C0H,080H,041H,000H,0C1H,081H,040H
DB
001H,0C0H,080H,041H,000H,0C1H,081H,040H,000H,0C1H,081H,040H,001H,0C0H,080H,041H
DB
000H,0C1H,081H,040H,001H,0C0H,080H,041H,001H,0C0H,080H,041H,000H,0C1H,081H,040H
DB
000H,0C1H,081H,040H,001H,0C0H,080H,041H,001H,0C0H,080H,041H,000H,0C1H,081H,040H
DB
001H,0C0H,080H,041H,000H,0C1H,081H,040H,000H,0C1H,081H,040H,001H,0C0H,080H,041H
DB
001H,0C0H,080H,041H,000H,0C1H,081H,040H,000H,0C1H,081H,040H,001H,0C0H,080H,041H
DB
000H,0C1H,081H,040H,001H,0C0H,080H,041H,001H,0C0H,080H,041H,000H,0C1H,081H,040H
DB
000H,0C1H,081H,040H,001H,0C0H,080H,041H,001H,0C0H,080H,041H,000H,0C1H,081H,040H
DB
001H,0C0H,080H,041H,000H,0C1H,081H,040H,000H,0C1H,081H,040H,001H,0C0H,080H,041H
DB
000H,0C1H,081H,040H,001H,0C0H,080H,041H,001H,0C0H,080H,041H,000H,0C1H,081H,040H
DB
001H,0C0H,080H,041H,000H,0C1H,081H,040H,000H,0C1H,081H,040H,001H,0C0H,080H,041H
DB
001H,0C0H,080H,041H,000H,0C1H,081H,040H,000H,0C1H,081H,040H,001H,0C0H,080H,041H
DB
000H,0C1H,081H,040H,001H,0C0H,080H,041H,001H,0C0H,080H,041H,000H,0C1H,081H,040H
 
DB
000H,0C0H,0C1H,001H,0C3H,003H,002H,0C2H,0C6H,006H,007H,0C7H,005H,0C5H,0C4H,004H
DB
0CCH,00CH,00DH,0CDH,00FH,0CFH,0CEH,00EH,00AH,0CAH,0CBH,00BH,0C9H,009H,008H,0C8H
DB
0D8H,018H,019H,0D9H,01BH,0DBH,0DAH,01AH,01EH,0DEH,0DFH,01FH,0DDH,01DH,01CH,0DCH
DB
014H,0D4H,0D5H,015H,0D7H,017H,016H,0D6H,0D2H,012H,013H,0D3H,011H,0D1H,0D0H,010H
DB
0F0H,030H,031H,0F1H,033H,0F3H,0F2H,032H,036H,0F6H,0F7H,037H,0F5H,035H,034H,0F4H
DB
03CH,0FCH,0FDH,03DH,0FFH,03FH,03EH,0FEH,0FAH,03AH,03BH,0FBH,039H,0F9H,0F8H,038H
DB
028H,0E8H,0E9H,029H,0EBH,02BH,02AH,0EAH,0EEH,02EH,02FH,0EFH,02DH,0EDH,0ECH,02CH
DB
0E4H,024H,025H,0E5H,027H,0E7H,0E6H,026H,022H,0E2H,0E3H,023H,0E1H,021H,020H,0E0H
DB
0A0H,060H,061H,0A1H,063H,0A3H,0A2H,062H,066H,0A6H,0A7H,067H,0A5H,065H,064H,0A4H
DB
06CH,0ACH,0ADH,06DH,0AFH,06FH,06EH,0AEH,0AAH,06AH,06BH,0ABH,069H,0A9H,0A8H,068H
DB
078H,0B8H,0B9H,079H,0BBH,07BH,07AH,0BAH,0BEH,07EH,07FH,0BFH,07DH,0BDH,0BCH,07CH
DB
0B4H,074H,075H,0B5H,077H,0B7H,0B6H,076H,072H,0B2H,0B3H,073H,0B1H,071H,070H,0B0H
DB
050H,090H,091H,051H,093H,053H,052H,092H,096H,056H,057H,097H,055H,095H,094H,054H
DB
09CH,05CH,05DH,09DH,05FH,09FH,09EH,05EH,05AH,09AH,09BH,05BH,099H,059H,058H,098H
DB
088H,048H,049H,089H,04BH,08BH,08AH,04AH,04EH,08EH,08FH,04FH,08DH,04DH,04CH,08CH
DB
044H,084H,085H,045H,087H,047H,046H,086H,082H,042H,043H,083H,041H,081H,080H,040H
NOP
NOP
LJMP MAIN


您可能还会关注的相关技术资料:

中国电子网
www.EC66.com
QQ:34740080 EMAIL:iloveaoe@163.com
最佳浏览:1024*768
Copyright (C) 2001-2010 EC66.COM All Rights Reserved
Aoe/帝国 制作维护
粤ICP备18061901号