EasyManuals Logo

Coronis Wavenis Wavecard User Manual

Default Icon
70 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #11 background imageLoading...
Page #11 background image
Wavecard-Waveport User Manual Coronis Systems
2.2.3 Sample CRC code (C language)
This example shows how to compute CRC on a fixed frame length equal to 9.
#include <iostream.h>
#include <stdio.h>
#include <string.h>
void main ( )
{
int Poly = 0x8408;
int lg = 9;
unsigned int Frame [] = { 0x0B, 0x20, 0x43, 0x06, 0x01, 0x00, 0x00, 0x02, 0X01};
unsigned int Crc;
int j, i_bits, carry;
Crc = 0;
for ( j=0 ; j < lg ; j++ )
{
Crc = Crc ^ Frame[j] ;
for ( i_bits=0 ; i_bits < 8 ; i_bits++ )
{
carry = Crc & 1 ;
Crc = Crc / 2 ;
if ( carry )
{
Crc = Crc ^ Poly;
}
}
}
printf ( “CRC = %x “, Crc);
}
Notes:
The computed CRC is: 41D2 hexadecimal
The LSB and MSB bytes must then be inverted before storing them in the frame.
CS-SUP-MUTI-WPORTAPP-E04 11

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Coronis Wavenis Wavecard and is the answer not in the manual?

Coronis Wavenis Wavecard Specifications

General IconGeneral
BrandCoronis
ModelWavenis Wavecard
CategoryMicrophone system
LanguageEnglish