User's Manual
Table Of Contents
- 1. INTRODUCTION
- 2. RS232 SERIAL PROTOCOL PRESENTATION
- 3. setting internal waveport CF parameters
- 3.1 Configuring functional parameters
- 3.2 Wake-up and synchronization
- 3.3 Configuring control parameters
- 3.3.1 Selecting RF communication mode
- 3.3.2 Selecting radio channel when FHSS is deselected
- 3.3.3 Selecting radio board transmission power
- 3.3.4 Activating RSSI threshold auto-correction
- 3.3.5 Selecting the serial baud rate
- 3.3.6 Reading Waveport CF firmware version
- 3.3.7 Reading RSSI
- 3.3.8 RSSI command format
- 3.3.9 TEST Mode
- 4. SERVICE COMMANDS
- 5. COMMUNICATION MODES
Waveport CF user manuel 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.
Compact_Flash-UserManual 11