View Full Version : Crc
grich
- 23rd April 2008, 09:24
Does any one have guide routine in PICBasic to calculate CRC16bit MODBUS ?
Thank,
Grich
Kamikaze47
- 26th April 2008, 06:30
A quick forum search found this:
http://www.picbasic.co.uk/forum/showthread.php?t=7646
grich
- 7th May 2008, 09:51
Thanks, and I found list below/
Is this routine right ?
Calcul_CRC16:
CRC16=$FFFF
For i=0 to (DataAmount -3)
CRC16=CRC16^DATACRC[i]
For j=1 to 8
IF CRC16.Bit0=1 Then
CRC16=$A001^(CRC16>>1)
Else
CRC16=CRC16>>1
EndIF
Next j
Next i
Return
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.