dsPIC33CH Programming Process

Last modified by Microchip on 2024/04/09 14:57

The Programming Process

To configure a dual-core device with a secondary core with PRAM, two projects must be set up, one for the main core and one for the secondary core. These two projects are incorporated into one HEX file by MPLAB® X IDE. The combined project file is programmed into the device's Flash memory. During start-up, the device will copy the secondary project's instructions from Flash into PRAM for execution by the secondary core. At device start-up, before the user application runs, the user must call the secondary start-up code which copies the secondary application from the program Flash to the high-speed PRAM for execution by the secondary core.

To configure a dual-core device with a secondary core with Flash, two projects must be set up, one for the main core and one for the secondary core. The application code of each core can be programmed individually as two separate HEX files. The main project has to be programmed first and then followed by the secondary project. During start-up, the main device can start the secondary device.

This page is part of a tutorial that provides information on using MPLAB Code Configurator (MCC) to customize main and secondary cores to leverage the maximum potential of a dual-core device. To support independent code development for each core, MCC can be started on either the main or secondary core's MPLAB X IDE project. Currently, you have a choice of developing with MCC Classic or with MCC Melody depending on the support for the device. Therefore, the process will be shown for both.

  • Hereafter, the main and secondary cores' MPLAB X IDE projects will be referred to as the main project and the secondary project, respectively.
  • MCC Classic refers to the cores as master and slave, so that tutorial will use those terms for main and secondary. Other than the terms used for the cores, the steps are the same.

Steps to configure the dual-core device through MCC:

  1. Create the main project in MPLAB X IDE and load MCC. You can choose either Classic or Melody.
  2. Configure the secondary core settings in the main project.
  3. Export the secondary core-related MCC settings from the main project and save them as a JSON file.
  4. Create a secondary project in MPLAB X IDE and load MCC.
  5. In the main core of the secondary project, import the JSON file which has secondary core-related MCC settings done in the main project. Configure other settings.
  6. Add the secondary project to the main project.

    Note: Step 6 is not applicable for dual-core devices with a secondary core with Flash. Refer to the device datasheet for more details.

Fuses related to the secondary core have to be configured in the main project. This information needs to be shared with the secondary project which is facilitated by exporting these settings from the main project and importing them into the secondary project using MCC. If this information is not shared, MCC will display the default setting values in the secondary project. However, these settings are not editable in the secondary project and are only shown to help you in independent code development. 

Learn More

Procedure

Using MCC Melody:

Using MCC Classic

Step-by-Step

Back to Top