AN2262 Motorola / Freescale Semiconductor, AN2262 Datasheet - Page 27

no-image

AN2262

Manufacturer Part Number
AN2262
Description
Wireless HC08 Modem
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
RF Reception
SPI Communication
MOTOROLA
Further mathematical details can be found in an article entitled “A Tutorial
on CRC Computations” published in the IEEE Micro Magazine dated August,
1988.
A table lookup algorithm has been chosen as a good compromise between
speed and memory consumption. A table of 256 constants that are 16 bits long
is stored in permanent storage (ROM like) memory. The actual CRC calculation
routine is simple:
int calc_crc(char *buf, unsigned char n)
{
int crc;
}
The same routine is used both to compute the CRC field before transmission
and also to check the CRC after reception of the data block. If the received data
block is correct, the result of the CRC computation of the data block (including
the received CRC field) is 0.
The data reception and decoding task is usually the most resource consuming
task in similar systems. RF-08 application makes the difference mainly
because of the heavy support from the MC33591/3 chip.
for the details about the hardware.
The MC33591/3 chip uniquely helps the microprocessor by providing all data
preprocessing, block start detection, and data clock recovery. The MC33591/3
receiver, besides some other functions, generates “clean” data with the
accompanied data clock after the block boundary mark appears. Such a data
stream is easily glued to SPI (serial peripheral interface) enabled devices like
the MC68HC908GP32 or its derivatives. Since
hardware, the description of the software services follows.
The SPI is another configurable peripheral module present in the M68HC08
Family. The SPI communication is of a master-slave type.
Here in the application the roles of master and slave change depending on
whether the MC33591/3 chip needs to be configured (MCU is the master,
MC33591/3 is the slave) or if MC33591/3 is in normal (reception) mode, then
MC33591/3 is the master leaving the MCU to be in the slave role. This is
relative to the SPI operation.
crc = 0;
while (n--)
return crc;
crc = ((crc >> 8) & 0xff) ^ crc_table[(crc ^ *buf++) & 0xff];
Wireless HC08 Modem
SPI Interface
MC33591/3 Receiver
describes the
AN2262/D
Software
27

Related parts for AN2262