Link Search Menu Expand Document

MCHP

CCL Manchester Encoder

This example application shows how to use the CCL peripheral library and generate a Manchester-encoded output.

Description

This demonstrates a way to generate a Manchester-encoded output using a SPI port and the CCL. The SPI port is sending out a predefined buffer of data in a circular fashion. Data is sent out LSB first, with CCL_OUT being the Manchester-encoded output. Pins are configured such that a logic analyzer can be attached to see the input (MOSI and SCK) and the output (CCL_OUT) simultaneously.

Downloading and building the application

To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.

Path of the application within the repository is apps/ccl/manchester_encoder/firmware .

To build the application, refer to the following table and open the project using its IDE.

Project Name Description
sam_c21n_xpro.X MPLABX project for SAMC21N Xplained Pro Evaluation Kit
sam_c21_xpro.X MPLABX project for SAM C21 Xplained Pro Evaluation Kit
   

Setting up the hardware

The following table shows the target hardware for the application projects.

Project Name Board
sam_c21n_xpro.X SAMC21N Xplained Pro Evaluation Kit
sam_c21_xpro.X SAM C21 Xplained Pro Evaluation Kit
   

Setting up SAMC21N Xplained Pro Evaluation Kit

  • Use jumper from PA17 (EXT2 pin 12) to PA09 (EXT2 pin 4) (This routes SCK signal to CCL_IN[4])
  • Use jumper from PA16 (EXT2 pin 11) to PA10 (EXT1 pin 5) (This routes MOSI signal to CCL_IN[5])
  • PA11 (EXT1 pin 6) has CCL output (CCL_OUT)
  • Connect the Debug USB port on the board to the computer using a micro USB cable

Setting up SAM C21 Xplained Pro Evaluation Kit

  • Use jumper from PA17 (EXT1 pin 15) to PA09 (EXT2 pin 4) (This routes SCK signal to CCL_IN[4])
  • Use jumper from PA16 (EXT1 pin 17) to PA10 (EXT2 pin 5) (This routes MOSI signal to CCL_IN[5])
  • PA11 (EXT2 pin 6) has CCL output (CCL_OUT)
  • Connect the Debug USB port on the board to the computer using a micro USB cable

Running the Application

  1. Connect a logic analyzer to MOSI pin
  2. Connect a logic analyzer to SCK pin
  3. Connect a logic analyzer to the Manchester-encoded output CCL_OUT pin
  4. Refer to the following table for pin details:

    Board MOSI pin SCK pin CCL_OUT pin
    SAMC21N Xplained Pro Evaluation Kit PA16 (EXT2 pin 11) PA17 (EXT2 pin 12) PA11 (EXT1 pin 6)
    SAM C21 Xplained Pro Evaluation Kit PA16 (EXT1 pin 17) PA17 (EXT1 pin 15) PA11 (EXT2 pin 6)
           
  5. Build and Program the application using its IDE
  6. Observe the output on logic analyzer, it should follow the truth table as shown in the following diagram:

    output



Copyright © 2020 Microchip Technology.