Getting Started Training Module Using MPLAB® Code Configurator (MCC): Step 1

Last modified by Microchip on 2023/11/15 12:56

Create a New 32-bit MCC Harmony Project

Select File > New Project from the main IDE menu.

MPLAB X IDE File > New Project menu

Back to top


In the Categories pane of the New Project dialog, select Microchip Embedded. In the Projects pane, select 32-bit MCC Harmony Project, then click Next.

New project wizard step 1

Back to top


Find the folder where you saved the framework in the Framework Path box, and then click Next to proceed.

  • The path to your MPLAB® Harmony 3 installation folder should already be populated. If not, create a folder somewhere on your computer, like C:\harmony3, and point the project to that framework path.
  • The MPLAB Harmony 3 necessary files will be downloaded to that path later during these steps.

New project wizard step 2

Back to top


In the Project Settings window, apply the following settings:

  • Location: Indicates the path to the root folder of the new project. All project files will be placed inside this folder. The project location can be any valid path, for example, C:\Users\xxxx\HarmonyProjects\same51n_getting_started.
  • Folder: Indicates the name of the MPLABX .X folder. Enter "sam_e51_cnano" to create a sam_e51_cnano.X folder.

Note: This must be a valid directory name for your operating system.

  • Name: Enter the project’s logical name as "getting_started_sam_e51_cnano". This is the name that will be shown from within MPLAB X IDE.
Information

Note: The Path box is read-only. It will update as you make changes to the other entries.

Click Next to proceed to Configuration Settings.

New project wizard step 3

Information

Note: Clicking on the Show Visual Help button will open a help window providing a detailed description of the various fields in the Project Settings window.

New Project Wizard Help window

Back to top


Follow the steps below to set the project’s Configuration Settings.

  • Name: Enter the configuration name as “sam_e51_cnano”.
  • Target Device: Select ATSAME51J20A as the target device.
Information

Note: You can select the Device Family or enter a partial device name to filter the list in Target Device to make it easier to locate the desired device.

  • After selecting the target device, click Finish to launch the MCC.

New project wizard step 4

Information

Note: If the Finish button is greyed out and if you are seeing the Update device pack button is enabled, then click on the Update device pack button to update the device pack.

New Project window

Back to top


The MCC content manager window is displayed. In this, click Select MPLAB Harmony (by default this option is selected).

MCC content manager select Harmony

Click Finish to start downloading the Required Content packages. The MCC opens the project graph once after downloading the required components.

MCC content manager select Finish

Tool Tip:

  • If you have already downloaded the required content or packages, MCC displays only the Optional Content table.
  • If your project needs additional packages or components, select the components in the Optional Content table and click Finish to download the packages.
  • The MCC opens the project graph once after downloading the selected optional components.

MCC content manager wizard

​​​​​Back to top


The MCC plugin’s main window for the project will be displayed as shown in the accompanying image.

New project wizard step 7

  • Resource Management has two sections. One is Project Resources and the other one is Device Resources.
    • Project Resources The project resources area shows all the peripherals that are already configured for the project. For example (CMSIS and Device Family Packs (DFP)). Select the peripheral here, and the peripheral is ready to be configured in the Composer area. In the Project Resource area, the System module is always present. The System module simplifies the setting of configuration bits and configures the system clock.
    • Device Resources The Device resources area displays available peripherals for the device. Click on the peripheral you want to add to your project. The peripheral moves to the MCC Project Resources area and is ready to be configured to your project's requirements. For example, MPLAB Harmony Peripheral Libraries (PLIBs) for your device.
  • Project Graph: shows the instantiated components. You can instantiate available components by double-clicking on the component in the Device Resources panel. After successful component instantiation, you can see the instantiated components under the Project Resources panel.
  • Configuration Options: Displays the tree view of the selected component under the Project Graph area. You can configure the selected optional component in this section.
Information

Tool Tip: If you closed MCC accidentally and would like to open it again, Click on the MCC button at the top to launch the MCC.

Information

Tool Tip: MCC, by default, has Autosave MCC configuration File option enabled. If you want to disable the MCC autosave option, go to Tools > Options. After opening the Options window, go to Plugins and disable the Autosave MCC configuration file option.

Options window Plugins tab

​​​​​Back to top


Before proceeding, set up the compiler toolchain.

Click the Projects tab on the top left pane. Right-click on the project name sam_e51_cnano.
Go to Set Configuration and click on Customize...

Set Configuration > Customize.. menu

Make sure that XC32 (v4.30) is selected as the Compiler Toolchain for XC32 and select the Simulator.
Click on Apply and then click on OK.

Project Properties window

​​​​​Back to top


Verify Clock Settings

Launch Clock Easy View by going to the Project Graph tab in the MPLAB X IDE and then selecting Plugins > Clock Configuration.

MCC plugins Clock Configuration

A new window, Clock Easy View, is opened in the project’s main window.

Back to top


Click on the Clock Easy View tab, scroll to the right, and verify that the Main Clock is set to 120 MHz.

clock_configuration_setup.png

Tool Tip: Double-click on the Clock Easy View tab to maximize the window.

Back to top