27.3.2 Data Shift Direction
The LENDIAN bit (CRCCON[3]) is used to control the shift direction. By
default, the CRC module will shift data through the engine, MSb first (LENDIAN = 0
). Setting LENDIAN to ‘1
’
causes the CRC module to shift data, LSb first. This setting allows better integration with
various communication schemes and removes the overhead of reversing the bit order in
software. Note that this only changes the direction the data is shifted into the engine.
The result of the CRC calculation will still be a normal CRC result, not a reverse CRC
result.
dsPIC33A devices are little-endian. When the
CRC module is configured for the big-endian (LENDIAN = 0
), the input data bytes and words must be swapped in the application code before
loading them into the data FIFO (CRCDAT registers).