Getting started with Microchip: SAM9x75-Curiosity-WVGA

SAM9X75 Curiosity LAN Kit with 5" WVGA LCD Display.
The following article explains all necessary steps to create an Embedded Wizard UI application suitable for the SAM9X75 Curiosity LAN Kit (EV31H43A) in combination with the AC69T88A - 5" WVGA LCD Display (AC69T88A) from Microchip.
Please follow these instructions carefully and step by step in order to ensure that you will get everything up and running on your target. In case you are not familiar with Embedded Wizard, please read first the chapter basic concepts and the Quick Tour tutorial to understand the principles of Embedded Wizard and the GUI development workflow.
First, make sure you have all of the following items:
Hardware components
★SAM9X75 Curiosity LAN Kit from Microchip
★AC69T88A - 5" WVGA LCD Display from Microchip
★5V Power adapter with barrel connector
★SD-Card 2GB or higher, FAT32 formated (for stand alone mode)
★Segger J-Link or Microchip J-32 debug probe (for debugging and MPLAB development)
Software components
★Embedded Wizard Studio Free or Embedded Wizard Studio Pro
If you want to use the Free edition of Embedded Wizard Studio please register on our website and download the software.
As a customer, please visit the Embedded Wizard Download Center (login/password required) and download Embedded Wizard Studio Pro.
★Embedded Wizard Build Environment for SAM9x75-Curiosity-WVGA
To evaluate Embedded Wizard on the mentioned target, you can download the suitable Build Environment from the following link:
SAM9x75-Curiosity-WVGA-BuildEnvironment-V14.00.00.00.zip
As a customer, please visit the Embedded Wizard Download Center (login/password required) and download the latest version of the Build Environment and your licensed Platform Package libraries or source codes.
Installing Tools and Software
IMPORTANT
The Build Environment for SAM9x75-Curiosity-WVGA supports only the SAM9X75 Curiosity board in combination with the AC69T88A display as described above. Other hardware and display combinations of the evaluation board are not tested.
★Step 1: Install the latest version of Embedded Wizard Studio.
★Step 2: Install the Microchip tools: MPLAB-X IDE and XC32 Compiler.
★Step 3: Unpack the provided Embedded Wizard Build Environment for SAM9x75-Curiosity-WVGA to your local file system (e.g. C:\Microchip[.]).
Embedded Wizard GUI Demos
If you just want to run our GUI demos on your SAM9x75-Curiosity-WVGA development board without building the different examples, you can simply use the precompiled binary file of the Embedded Wizard Master Demo.
The Embedded Wizard Master Demo combines a variety of examples within one huge demo application. It can be used for presentations and showcases. Each demo application can be activated from a common main menu. To return back from a demo application to the main menu, a small home button appears on top of every demo. Additionally, the Master Demo contains an auto-demo mode that presents one demo application after the other. The auto-demo starts automatically and stops as soon as the user touches the screen.
In order to run the binary file to your target, please follow these steps:
★Copy the file harmony.bin and the file boot.bin that you will find in the subdirectory \MasterDemo to a FAT32 formated SD-Card and insert it into the SD-Card socket SD-BOOT (J14) on your SAM9x75-Curiosity-WVGA target.
★Connect the 5V Power adapter or press the RESET button, if the board is already powered.
TIP
Precondition to run this application is a pre-installed bootloader. If the bootloader is up and running, on RS232 console there should be a cyclically output of RomBOOT (see also section 'Console output' below).
If bootloader is not up and running on your SAM9x75-Curiosity board, please refer to SAM9X75 Curiosity LAN Kit - Quick Start Guide for MPLAB Harmony v3.
To avoid booting from onboard memory, please open both jumpers, Jumper J9 (NAND Boot) and Jumper J10 (QSPI Boot).

'Master Demo' running on SAM9x75-Curiosity-WVGA development board.
Exploring the Build Environment
The provided Embedded Wizard build environment for SAM9x75-Curiosity-WVGA contains everything you need to create, compile, link and flash an Embedded Wizard UI application for the SAM9x75-Curiosity-WVGA target. After unpacking, you will find the following subdirectories and files:
•StartGccBuildEnvironment.bat - This script file is provided to start a windows command line to build your GUI applications suitable for the desired target.
•\Application - This folder contains ready-to-use projects to compile and link an Embedded Wizard generated UI application. They are used for all provided examples and they can be used to build your own UI applications.
•\GeneratedCode - This folder is used to receive the generated code from an Embedded Wizard UI project. All template projects are building the UI application out of this folder. You can create your own UI project and generate the code into the subdirectory \GeneratedCode without the need to adapt the project.
•\Project - This folder contains the prepared projects for GCC (make) and MPLAB-X.
•\Source - This folder contains the files main.c and ewmain.c. There you will find the initialization of the system and the main loop to drive an Embedded Wizard GUI application. The file ewconfig.h contains general configuration settings for the target system, like memory ranges and display parameter and configuration settings for the Embedded Wizard Graphics Engine and Runtime Environment. Additionally, this folder contains the device driver C/H files used for the DeviceIntegration example.
•\Examples\<ScreenSize> - This folder contains a set of demo applications prepared for a dedicated screen size (480x270 pixel). Each example is stored in a separate folder containing the entire Embedded Wizard UI project. Every project contains the necessary profile settings for the SAM9x75-Curiosity-WVGA target. The following samples are provided:
•\HelloWorld - A very simple project that is useful as starting point and to verify that the entire toolchain, your installation and your board is properly working.
•\ScreenOrientation - This demo shows, that the orientation of the UI application is independent from the physical orientation of the display.
•\DeviceIntegration - This example shows the integration of devices into a UI application and addresses typical questions: How to start a certain action on the target? How to get data from a device?
•\GraphicsAccelerator - This application demonstrates the graphics performance of the target by using sets of basic drawing operations that are executed permanently and continuously.
•\BrickGame - The sample application BrickGame implements a classic "paddle and ball" game. In the game, a couple of brick rows are arranged in the upper part of the screen. A ball travels across the screen, bouncing off the top and side walls of the screen. When a brick is hit, the ball bounces away and the brick is destroyed. The player has a movable paddle to bounce the ball upward, keeping it in play.
•\ClimateCabinet - The ClimateCabinet demo shows the implementation of a control panel for a climatic exposure test cabinet. The user can define a heating time, a nominal temperature and humidity, a dwell time and the final cooling time.
•\Dashboard - The sample application Dashboard shows the implementation of a car dashboard. The application demonstrates the usage of vector graphics created from svg path data and how transitions between two dashboard variants and further UI components can be achieved.
•\PaperCutter - This demo shows the implementation of a paper cutting machine, where the user can define the pagination and format of the paper as well as the cutting speed and the amount of papers. The application contains many rect effects and fade-in/fade-out effects to change dynamically the layout of the screen.
•\PulseOximeter - The sample application PulseOximeter shows the implementation of a medical device for monitoring a person's pulse frequency and peripheral oxygen saturation. The application demonstrates the usage of vector graphics within graphs and circular gauges.
•\SmartThermostat - The SmartThermostat demo application shows the implementation of a fancy, rotatable temperature controller to adjust and display the nominal and actual temperature.
•\WashingMachine - This demo shows the implementation of a washing machine with a couple of fancy scrollable list widgets to choose the washing program and parameters. The speciality of this sample application is the magnification effect of the centered list items and the soft fade-in/fade-out effects.
•\WaveformGenerator - This WaveformGenerator demo application combines waveforms with different amplitudes and frequencies. The implementation shows the usage of vector graphics to draw a curve based on a list of coordinates.
•\PlatformPackage - This folder contains the necessary source codes and/or libraries of the SAM9 Platform Package: Several Graphics Engines for the different color formats (currently RGBA8888 only) and the Runtime Environment (in the subdirectory \RTE).
•\TargetSpecific - This folder contains all configuration files and platform specific source codes. The different ew_bsp_xxx files implement the bridge between the Embedded Wizard UI application and the underlying board support package (Microchip hardware drivers) in order to access the display, the serial interface and the clock.
•\ThirdParty - This folder contains third-party source codes and tools:
•\Make - This folder contains a make tool to build the entire GUI application via command line.
Creating the UI Examples
For the first bring up of your system, we recommend to use the example 'HelloWorld':

Example 'HelloWorld' within Embedded Wizard Studio.
The following steps are necessary to generate the source code of this sample application:
★Navigate to the directory \Examples\<ScreenSize>\HelloWorld.
★Open the project file HelloWorld.ewp with your previously installed Embedded Wizard Studio. The entire project is well documented inline. You can run the UI application within the Prototyper by pressing Ctrl+F5.
★To start the code generator, select the menu items - or simply press F8. Embedded Wizard Studio generates now the sources files of the example project into the directory \Application\GeneratedCode.
Compiling, Linking and Flashing
The following steps are necessary to build and flash the Embedded Wizard UI sample application using the GCC ARM embedded toolchain:
★Navigate to the top level of the Build Environment.
★Open StartGccBuildEnvironment.bat - as a result, a windows command line window should open. In case of error messages, please adapt the path settings in StartGccBuildEnvironment.bat according to your environment.
★Now start compiling, linking and flashing:
make
If everything works as expected, the application binary harmony.bin is now available in the subdirectory \Application\Project\GCC\Bin.
In order to run the binary file to your target, please follow these steps:
★Copy the file harmony.bin and the file boot.bin that you will find in the subdirectory \MasterDemo to a FAT32 formated SD-Card and insert it into the SD-Card socket SD-BOOT (J14) on your SAM9x75-Curiosity-WVGA target.
★Connect the 5V Power adapter or press the RESET button, if the board is already powered.
TIP
Precondition to run this application is a pre-installed bootloader. If the bootloader is up and running, on RS232 console there should be a cyclically output of RomBOOT (see also section 'Console output' below).
If bootloader is not up and running on your SAM9x75-Curiosity board, please refer to SAM9X75 Curiosity LAN Kit - Quick Start Guide for MPLAB Harmony v3.
To avoid booting from onboard memory, please open both jumpers, Jumper J9 (NAND Boot) and Jumper J10 (QSPI Boot).

Example 'HelloWorld' running on SAM9x75-Curiosity-WVGA development board.
All other examples can be created in the same way: Just open the desired example with Embedded Wizard Studio, generate code and rebuild the whole application and transfer the binary to the SD-Card.
Creating your own UI Applications
In order to create your own UI project suitable for the SAM9x75-Curiosity-WVGA target, you can create a new project and select the SAM9x75-Curiosity-WVGA project template:

As a result you get a new Embedded Wizard project, that contains the necessary Profile attributes suitable for the SAM9x75-Curiosity-WVGA development board:

The following profile settings are important for your target:
★The attribute PlatformPackage should refer to the SAM9 Platform Package.
★The attribute ScreenSize should correspond to the display size of the SAM9x75-Curiosity-WVGA development board.
★The attributes ModeOfBitmapResources and ModeOfStringConstants can be set to DirectAccess in case that the resources should be taken directly from flash memory. By default these attributes are set to Compressed.
★The attribute OutputDirectory should refer to the \Application\GeneratedCode directory within your Build Environment. By using this template, it will be very easy to build the UI project for your target.
★The attribute CleanOutputDirectories should be set to true to ensure that unused source code within the output directory \Application\GeneratedCode will be deleted.
★The attribute PostProcess should refer to \Application\Project\MPLAB\EmbeddedWizard_PostProcess\MPLAB_ew_post_process.cmd if you are working with MPLAB-X. In case of the GCC ARM embedded toolchain leave it blank
Now you can use the template project in the same manner as it was used for the provided examples to compile, link and flash the binary.
After generating code, please follow these steps, in order to build your own UI application:
★Start the batch file StartGccBuildEnvironment.bat. Again, a windows command line window should open.
★Start compiling and linking:
make
★Transfer the binary to the SD-Card (as described above) and restart the target.
Most of the project settings are taken directly out of the generated code, like the color format or the screen orientation. All other settings can be made directly within the file ewconfig.h, which contains general configuration settings for the target system.
Console output
In order to receive error messages or to display simple debug or trace messages from your Embedded Wizard UI application, a serial terminal like 'Putty' or 'TeraTerm' should be used.
For a serial connection a COM Port adapter (USB-to-TTL serial cable) is needed as described in the 'SAM9X75 Curiosity User Guide'(section 3.5.2, Serial Debug COM Port).
★As soon as you connect your COM Port adapter with the PC via USB, a new virtual Com Port appears within your system device list. Open the device manager to get the port number of this COM port.
★Now you can open your terminal application and connect it via COMx with the following settings: 115200-8-N-1

This terminal connection can be used for all trace statements from your Embedded Wizard UI applications or for all debug messages from your C code.
Using Microchip MPLAB-X
If you want to use the Microchip MPLAB-X instead of the GCC ARM embedded toolchain, please follow these instructions:
Generating Code with Embedded Wizard Studio:
★Open the desired Embedded Wizard example project. All Embedded Wizard examples will store the generated code within the common /Application/GeneratedCode folder.
★Select the Profile and set the attribute PostProcess to the file ..\..\..\Application\Project\MPLAB\EmbeddedWizard_PostProcess\MPLAB_ew_post_process.cmd.
★To start the code generator, select the menu items - or simply press F8. Embedded Wizard Studio generates now the sources files of the example project into the directory \Application\GeneratedCode. After the Embedded Wizard code generation the installed post process will adapt the MPLAB-X project.
Please assure, that the MPLAB x project is closed during Embedded Wizard Code generation.
★Since there is is a path length issue with MPLABX IDE, it is recommended to unpack the complete SAM9x75-Curiosity-WVGA Build Environment to a short path position (e. g. below C:\Microchip). Alternatively, a symbolic link can be added on this position using Windows administrator console and mklink /D.
Compiling, linking and downloading:
★Open the MPLAB-X template project from the folder \Application\Project\MPLAB. It is commonly used for all provided Embedded Wizard examples.
★Set the EmbeddedWizard-SAM9x75-Curiosity-WVGA project as main project.
★Build the project using and download it to your target platform.
TIP
If the Embedded Wizard PostProcess is executed while the MPLABX project is opened in MPLABX IDE, the MPLAB project view will NOT be updated automatically.
Anyway, if using , the updated project setting will be used.
Alternatively, please close the MPLABX project before rebuilding the Embedded Wizard project and re-open it afterwards.
Release notes
The following section contains the version history of the Build Environment (including Graphics Engine and Runtime Environment) for SAM9x75-Curiosity-WVGA. These release notes describe only the platform specific aspects - for all general improvements and enhancements please see the Embedded Wizard release notes.
Version 14.00.00.00
★Initial support for SAM9x75-Curiosity-WVGA.
★Using Graphics Engine (GFX) and Runtime Environment (RTE) V14.00.
★Using Microchip XC32 C-Compiler V4.35.
★Using Microchip MPLAB-X IDE V6.20.
