UM001
29
3.8
Checksum / CRC
The serial interface provides the option for either an 8-bit checksum or a 16-bit CRC. In the event neither
the checksum nor the CRC is needed, both can be turned off by the user. Refer to the Communication
Protocol Control Register for details on disabling the checksum/CRC.
3.8.1
Checksum Bypass
When communicating with the sensor using a serial terminal, the checksum calculation can be bypassed
by replacing the hexadecimal digits in the checksum with uppercase X characters. This works for both the
8-bit and 16-bit checksum. An example command to read register 1 is shown below using the checksum
bypass feature.
$VNRRG,1*XX
3.8.2
8-bit Checksum
The 8-bit checksum is an XOR of all bytes between, but not including, the dollar sign ($) and asterisk (*).
All comma delimiters are included in the checksum calculation. The resultant checksum is an 8-bit number
and is represented in the command as two hexadecimal characters. The C function snippet below
calculates the correct checksum.
Example C Code
// Calculates the 8-bit checksum for the given byte sequence.
unsigned char
calculateChecksum(
unsigned char
data[],
unsigned int
length)
{
unsigned int
i
;
unsigned char
cksum = 0;
for(i=0; i<length; i++){
cksum ^= data[i];
}
return cksum;
}
Содержание VN-100
Страница 1: ...UM001 1 Firmware v2 1 0 0 Document Revision 2 22 VN 100 User Manual Embedded Navigation Solutions...
Страница 9: ...UM001 9 2 Specifications 2 1 VN 100 Surface Mount Sensor SMD Electrical Pin assignments top down view...
Страница 14: ...14 UM001 2 3 VN 100 Surface Mount Sensor SMD Dimensions Measurements are in inches 2 4 VN 100 Rugged Dimensions...
Страница 102: ...102 UM001 8 3 Factory Defaults Settings Name Default Factory Value Magnetometer Calibration Control 1 3 5...
Страница 113: ...UM001 113 9 5 Factory Defaults Settings Name Default Factory Value Velocity Compensation Control 1 0 1 0 01...