Skip to content

Setting Orientation External Controller

Bill Li edited this page Sep 6, 2024 · 3 revisions

Microchip Technology Setting Orientation for External Display Controller Driver

Set orientation for UI design on LCC Display Driver. Start by launching MPLABX IDE, launch a quickstart Harmony v3 project, launch MHC, launch composer, configure orientation properties, generate, and build and program.

The quickstart application we will use is release for 270 orientation. This guide will transition the application to 90 degree.

Launch MPLABX

Launch MPLABX on your development PC.

Microchip Technology

Load Quickstart into Workspace

Load the quickstart project. You have the option of loading any MPLABX project. In this example we will load legato_qs_e54_cult_cpro_parallel.X.

Under File menu, select Open Project.

In the file dialog, select project .X file. In our example, we will use: legato_qs_e54_cult_cpro_parallel.X.

Microchip Technology

Launch MHC

This is an external controller based design. For many external controllers orientation is managed by a set of control register commands. These commands are also called flip or rotate. The LE External Controller component supports the sending of orientation commands to the display controller. This project uses an external ILI9488 display controller. You will change initialization for the Memory Access Control register. ILI9488 supports:

| --- | --- |

Orientation Memory Access Control Value
Portrait 0 Degree 0x48
Landscape 90 Degree 0x28
Portrait 180 Degree 0x88
Landscape 270 Degree 0xE8

To change the memory access control, launch MHC from MPLABX.

Microchip Technology

MHC can also be launched in stand-alone mode. Go to MHC folder directory (/<Harmonypath>/mhc/) and double click the runmhc.bat file.

Click the LE External Controller component. Click Configuration Options and expand Initialization Settings. Expand CMD[3] and Number of Parameters. Set PARAM[0] to 0xE8.

Launch Composer

Composer will be used to set the UI display size to landscape. There is no need to change the library settings, otherwise the library will attempt to override the display controller. Composer settings should remain at 0 orientation. The display controller is responsible for orientation.

Microchip Technology

Open Project Settings

Open Project Settings Panel. Select Project, click on Project Settings.

Microchip Technology

Select Display Settings tab. Set width to 480 and height to 320. See illustration:

Microchip Technology

Select Library Settings tab. Input Orientation to 0 and **Software Rendering Orientation to 0. See illustration:

Microchip Technology

Rearrange pre-configured graphics UI design

Reposition the existing landscape UI widgets to align to the new portrait orientation.

Microchip Technology

Note: The backgroundPanel widget size should be modified as illustrated:

Microchip Technology

Generate Harmony3 code and project files

Microchip Technology

Save configuration and generaton project. MHC will generate all required projects files including a skeleton application code. These files are located in the project.

Build Quickstart

Build the quickstart workspace.

Under Project menu, select Rebuild All.

Microchip Technology

Program Quickstart

Select Run Main Project. This button will build, program, and run the application.

Microchip Technology

Summary

In this guide, you learned to set a 90 degree orientaion for a external based design. You started with a 270 degree orientation project, configured it for 90 degree orientation and repositioned the widgets, generate, build and program your project.


If you are new to MPLAB® Harmony, you should probably start with these tutorials:


Clone this wiki locally