Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CRCCU Example
Purpose

This example demonstrates the Cyclic Redundancy Check Calculation Unit (CRCCU) provided on SAM series microcontrollers. It shows how to use CRCCU to compute CRC on a memory area.

Requirements

This package can be used with SAM4L series.

Description

The example work as: a. Initialize a buffer in SRAM with random data; Initialize a buffer in Flash with the same data as in SRAM. b. Initialize the CRCCU to compute the CRC of the buffer in SRAM with one of the 3 CRC algorithms. c. Start the computation. d. Read the result and display it. e. Calculate and display the CRC result in Flash and compare it with the result in SRAM . f. Redo b, c, d, e with 2 other CRC modes.

Compilation Info

This software was written for the GNU GCC and IAR EWARM. Other compilers may or may not work.

Usage
  1. Build the program and download it inside the evaluation board.
  2. On the computer, open and configure a terminal application (e.g. HyperTerminal on Microsoft Windows) with these settings:
    • 115200 bauds
    • 8 bits of data
    • No parity
    • 1 stop bit
    • No flow control
  3. Start the application.
  4. In the terminal window, the following text should appear (values depend on the board and chip used):
    -- CRCCU Example --
    -- SAMXX-EK
    -- Compiled: XXXXXXXX --
    ...