This page shows how to copy an existing MLA graphics project. After creating the new project the developer can modify the code to meet the application needs. The method of copying/modifying a working project is a simple and easy to understand approach to graphics project creation. This approach is less prone to error and easily accomplished by someone new to Microchip MLA graphics.
There are other methods of creating graphics projects such as using the Graphics Display Designer (GDD-X) tool or creating a project "from scratch". To effectively use the GDD-X many of the concepts yet to be presented in tutorial need to be understood. It is recommended that after completing this tutorial the student use GDD to create MLA graphics application project.
1 Identify a project to copy
There are several projects in the MLA graphics directory. Each project demonstrates how to implement some unique features of the MLA. To demonstrate these features certain files and project settings were configured in the projects by experienced Microchip engineers. By copying a project which includes the features you are most interesting in using a user will not have to go through a possibly complex project setup procedure. Experience has shown this is a superior approach for customers new to the graphics MLA.
This example below shows how to copy the project "app_notes" project
2 Test the project on your development board
From MPLABX the App_Note project can be run by opening the project:
Before attempting to run the project MPLABX® IDE, a compiler( MPLAB®XC32 or MPLABX®XC16) and the MLA must be installed. A development board with an MLA supported display and a programmer/debugger will also be needed. Click Here to see the hardware tools used in the examples and exercises in this tutorial.
Open the project
Select the Open Project icon
located in the MLA installation directory
Open the project by selecting app_notes.X
then selecting "Open Project"
Set the Project Configuration
MLA projects have one configuration for each supported development board. To set a configuration as active use the pull down menu in MPLABX's toolbar.
In this example the project uses the PIC24FJ256DA210 development board connected to a QVGA display. Using a combination of the horizontal and vertical scroll bars on the pull down menu you will be able to locate the configuration for your particular development setup.
Set up the programmer and compiler version
Examine the Project Properties to verify two items. Verify the compiler and version specified for the project matches the compiler and version installed. Verify the programmer/debugger connected to the computer is the one called for in the project properties.
Make all necessary changes so the Project Properties for the project the compiler and programmer/debugger.
Run the Program on your hardware
Select the Make and Program Device icon form MPLABX's main toolbar. The project will build, connect to the programmer/debugger, program the device on the development board, then release the MCLR line. The application will begin to run, displaying a series of images on the screen.
The App Notes Project utilizes the resistive touch screen on of the display. By following the directions on the screen one can work through the demo and observe a handful of the graphics capabilities available.
The first time a development board runs an MLA Graphics project utilizing a touch screen a special calibration routine may be run to make sure the system can properly detect the location of touches. The calibration routine places some arrows on the screen and asks you to touch them. Upon the completion the calibration routine will pass control on to the Object Layer Demo
3 "Package" the project files
Rather than recreate the project structure and copy individual files, use the IDE's *Package utility* to create a copy of the project. Packaging a project creates a zip file containing all the project files and directories. When unzipped, the developer can begin developing code within the new project.
4 Adjust the Project Settings
- Once the new project has been copied, re-verify the Project Properties are set for the installed compiler version and programmer/debugger. (This step uses the identical procedures to the ones used on the original MLA project)
- The next step is to remove all the unused configurations from the project. Having a significant number of unused configurations in a project can slow down MPLABX's ability to parse and scan the project… this can slow down the IDE's response to some user commands.
- To remove unused configurations select the Manage Configurations button from the Project Properties page.
- A box will appear listing all the configurations for the current project. By selecting the Remove button you can delete the highlighted configuration. Care should be taken not to delete the active configuration. The current active configuration is marked with the words (Active).
- At the end of the process only the Active configuration should remain.
- Before you test your project you may wish to rename this new project to a name other than what the MLA project is called. To do this, right click on the project name in the Project Page. When the list of options appear select Rename…. Follow the instructions to complete renaming the project:
5 Test the New Project
After the MCU, compiler, programmer/debugger, and the configuration has been set on the new project you are ready to verify that the project runs. To test the project, click the Make and Program Device Icon. The new project will build, connect to your programmer/debugger, and program the device. When the device has been programmed the MCLR line will be released and the new application will run just as the original MLA project ran.