Microchip MPLAB-X - Integration on Windows
From ERIKA WIKI
Contents
Synopsys
This guide illustrates how to integrate ERIKA Enterprise v3 in Microchip MPLAB-X IDE.
Preconditions
- Download the MPLAB-X Scripts package from ERIKA Enterprise v3 download page.
- Extract the downloaded package (ee3_MPLAB-X_scripts_YYYYMMDD_ghNN.zip) in "C:\Evidence" folder.
- Rename extracted "ee3_MPLAB-x" folder in "erika3".
- Download and Install MPLAB-X IDE v4.05 for windows.
- Download and Install MPLAB XC16 C Compiler v1.33 for windows.
- dsPIC33EV 5V CAN-LIN STARTER KIT board connected to PC via USB cable.
MPLAB-X IDE User Makefile Project
Project Creation
- Click on File->New Project... menu entry as shown in the following figure:
- The MPLAB-X IDE Project Wizard will open as shown in the following figure:
- Select Microchip Embedded folder into Categories Panel.
- Select User Makefile Project project into Projects Panel.
- Click on Next > button.
Device Selection
- The wizard will show the window to select the Device as shown in the following figure:
- Select the correct device: 16-bit DSCs (dsPIC33) and dsPIC33EV256GM106.
- Click on Next > button.
Tool Selection
- The Wizard will show the available debugging tools as shown in the following figure:
- Select the correct tool: PICKit 3 Starter Kit....
- Click on Next > button.
Project Name and Folder
- The Wizard will show the project name and folder as shown in the following figure:
- Fill the Project Name field (e.g erika3app).
- Browse the Project Loaction (e.g. C:\Evidence\MPLABXProjects)
- Click on Next > button.
User Makefile Creation
- The wizard will show the User Makefile Creation as shown in the following figure:
- Fill Working Directory field with . (dot).
- Fill Build command and Debug build command fields with ee3_app.bat.
- Fill Clean command" field with ee3_clean.bat.
- Fill Image name and Debug image name fields with out/erika3app.elf.
- Finally, click on the Finish button to instantiate the MPLAB-X IDE Project from with chosen options as shown in the following figure:
ERIKA v3 Scripts
- Click on Files tab-sheet of the upper-left panel to show the Project Files as shown in the following figure:
- Copy the following script files from C:\Evidence\erika3\mplabx folder into project folder as shown in the following figure:
- ee3_app.bat
- ee3_cfg.bat
- ee3_clean.bat
ERIKA v3 Application
- Copy example source files from any C:\Evidence\erika3\examples sub-folder into project folder as shown in the following figure:
Project Build
- To build the ERIKA Enterprise v3 example click on Production->Build Main Project menu entry as shown in the following figure:
- The build project process starts as shown in the following figure:
- Finally the build process ends successfully as shown in the following figure:
Project Debug
- To debug the ERIKA Enterprise v3 example click on Debug->Debug Main Project menu entry as shown in the following figure:
- The build project process starts as shown in the following figure:
- The build process ends successfully as shown in the following figure:
- The Device Voltage dialog window may appear as shown in the in the following figure:
- Click on the OK button to let program the device as shown in the following figure:
- Finally the programming process ends successfully and the application runs as shown in the following figure:
- Click into Pause button to debug the application as shown in the following figure:
MPLAB-X IDE Standalone Project
- Click on File->New Project... menu entry as shown in the following figure:
- The MPLAB-X IDE Project Wizard will open as shown in the following figure:
- Select Microchip Embedded folder into Categories Panel.
- Select Standalone Project project into Projects Panel.
- Click on Next > button.
- The wizard will show the window to select the Device as shown in the following figure:
- Select the correct device: 16-bit DSCs (dsPIC33) and dsPIC33EV256GM106.
- Click on Next > button to let the Wizard to show the available debugging tools as shown in the following figure:
- Select the correct tool: PICKit 3 Starter Kit....
- Click on Next > button to let the Wizard to show the available compilers as shown in the following figure:
- Select the correct compiler: XC16 (v1.33).
- Click on Next > button to let the Wizard to show the project name and folder as shown in the following figure:
- Fill the Project Name field (e.g erika3app).
- Browse the Project Loaction (e.g. C:\Evidence\MPLABXProjects)
- Finally, click on the Finish button to instantiate the MPLAB-X IDE Project from with chosen options as shown in the following figure:
- Click on Files tab-sheet of the upper-left panel to show the Project Files as shown in the following figure:
- Copy the following script files from C:\Evidence\erika3\mplabx folder into project folder as shown in the following figure:
- ee3_pull.bat
- ee3_cfg.bat
- ee3_clean.bat
- Copy example source files from any C:\Evidence\erika3\examples sub-folder into project folder as shown in the following figure:
- Right-Click on the ee_pull.bat file in the project and select Run context-menu entry to pull ERIKA Enterprise v3 into project as shown in the following figure:
- The pull process starts as shown in the following figure:
- The pull process ends successfully as shown in the following figure:
- Click on Projects tab-sheet of the upper-left panel to show the Project Folders.
- Right-Click on the Source Files folder in the project and select Add Existing Item... context-menu entry to add source files into project build system as shown in the following figure:
- From the project root select application source files and then click Select button as shown in the following figure:
- The application source files will be added to project source files folder as shown in the following figure:
- Right-Click on the Source Files folder in the project and select Add Existing Item... context-menu entry to add source files into project build system as shown in the following figure:
- From the project out sub-folder select ee_applcfg.c source files and then click Select button as shown in the following figure:
- The application configuration source files will be added to project source files folder as shown in the following figure:
- Right-Click on the Source Files" folder in the project and select Add Existing Item... context-menu entry to add source files into project build system as shown in the following figure:
From the project erika/src sub-folder select all *.c and all *.S source files and then click Select button as shown in the following figure:
- The ERIKA Enterprise v3 source files will be added to project source files folder as shown in the following figure:
- Right-Click on the project and select Properties context-menu entry as shown in the following figure:
- The Project Properties dialog window will open as shown in the following figure:
- Select XC16 (Global Options) from the Categories: panel.
- Select Global Options from the Option categories:".
- Click on the '...' button of Common include dirs as shown in the following figure:
- The Common include dirs dialog window will appear as shown in the following figure:
- Click on the Browse... button to add the followings include dirs:
- out
- erika\src
- erika\inc
- Then click on the OK' button as shown in the following figure:
- The ERIKA v3 include dirs will be added, then click OK to confirm as shown in the following figure:
- To build the ERIKA Enterprise v3 example click on Production->Build Main Project menu entry as shown in the following figure:
- The build project process starts as shown in the following figure:
- Finally the build process ends successfully as shown in the following figure:
- To debug the ERIKA Enterprise v3 example click on Debug->Debug Main Project menu entry as shown in the following figure:
- The build project process starts as shown in the following figure:
- The build process ends successfully as shown in the following figure:
- The Device Voltage dialog window may appear as shown in the in the following figure:
- Click on the OK button to let program the device as shown in the following figure:
- Finally the programming process ends successfully and the application runs as shown in the following figure:
- Click into Pause button to debug the application as shown in the following figure:
Additional Notes
T.B.D.