Create a Web-Enabled Digital Photo Frame: Step 7

Last modified by Microchip on 2023/12/15 17:33

Adding and Configuring Graphics Components

For graphics, the TM4301B display will be used in conjunction with the SSD1963 Graphics Board connected to J601.

Add and Connect Graphics Components

PDA TM4301B Display

From Device Resources, add the PDA TM4301B display.

Adding Display to the Project Graph

Figure: Adding Display to the Project Graph

SSD1963 Display Driver

Then add the LE SSD1963 driver.

Adding Graphics Driver to the Project Graph

Figure: Adding Graphics Driver to the Project Graph

Click on Yes for auto-activation.

Auto-Activation of GFX Code LE component

Figure: Auto-Activation of GFX Code LE component

Back to Top

LE Parallel (EBI)

Add the LE Parallel (EBI) from the red diamond on the LE SSD1963 component.

Adding LE Parallel to the Project Graph

Figure: Adding LE Parallel to the Project Graph

Back to Top

EBI Peripheral

From the LE Parallel (EBI) EBI CS red diamond, add the EBI (ebi) dependency.

Adding EBI Peripheral to the Project Graph

Figure: Adding EBI Peripheral to the Project Graph

Back to Top

Link the driver with the display.

Linking the Display Driver with the Display

Figure: Linking the Display Driver with the Display

Back to Top

Legato Component

For the Display Driver, add the Legato framework.

Adding Legato Library

Figure: Adding Legato Library

Back to Top

Touch Panel

maXTouch® Controller

From the Display, add the Touch Panel MaxTouch.

Adding Max Touch Controller

Figure: Adding Max Touch Controller

Back to top


I2C Driver

For MaxTouch, the I2C driver is needed, add it by clicking the yellow diamond on DRV_I2C.

Adding I2C Driver

Figure: Adding I2C Driver

Back to top


I2C Peripheral

The I2C driver is needed to use the I2C peripheral. On this board, the I2C2 is used.

Adding I2C Peripheral

Figure: Adding I2C Peripheral

Back to top


Input System Service

The MaxTouch driver is needed for the Input System Service.

Right-click on the yellow bullet to add it.

Adding the Input System Service

Figure: Adding the Input System Service

Back to top


Project Graph - GFX Components Overview

Overview of Graphics Components

Figure: Overview of Graphics Components

Back to Top

Configure Graphics Components

GFX Pin Configuration

Open the PIN Configuration plugin.

There are a few pins to be set to have the display working.

 EBI Pins

In the PIC32MZ EF Curiosity 2.0 User Guide, the chapter schematics, we have the pins used for EBI.

The Pin Diagram is easy to use for this.

Curiosity 2.0 Schematic - EBI Pin Allocation

Figure: Curiosity 2.0 Schematic - EBI Pin Allocation

Use the Pin Diagram in the Pic Configuration plugin to configure the pins as EBIDxx.


DISPLAY Pins

There are some pins needed for controlling the display driver.

Set them as GPIO and then give them the needed names (in bold), copy/paste after making it GPIO.

  • Pin 12 – RC3 – GPIO Out High - “GFX_DISP_INTF_PIN_WR”
  • Pin 29 – RJ14 – GPIO Out Low - “GFX_DISP_INTF_PIN_RESET”
  • Pin 51 – RK1 – GPIO Out High - “GFX_DISP_INTF_PIN_RSDC”
  • Pin 52 – RK2 – GPIO Out High - “GFX_DISP_INTF_PIN_CS”
  • Pin 53 – RK3 – GPIO Out High - “GFX_DISP_INTF_PIN_RD”
  • Pin 104 – RD0 – GPIO In - “BSP_MAXTOUCH_CHG”

Example for the GFX_DISP_INTF_PIN_WR pin:

Choose the GPIO function for the pin:

GPIO function for the pin

Result:

GPIO function for the pin Result

Give the custom name to the pin (copy/paste): “GFX_DISP_INTF_PIN_WR”.

Give the custom name to the pin

Set the pin as Output by clicking on the Direction options.

Set the pin as Output

Result:

Set the pin as Output Result

Change the Latch to High by clicking on the Latch options.

Change the Latch to High

Result:

Change the Latch to High Results

Back to top


Final Pin Configuration

Final Pin Configuration

Figure: Final Pin Configuration

Back to Top

Graphics Components Setup

LE SSD1963 Display Driver

LE SSD1963 Display Driver

RTOS Settings

Since the graphics application also needs to be quick, the RTOS Task Delay should be set to 1 ms.

SSD1963 RTOS Configurations

Figure: SSD1963 RTOS Configurations

Back to top


Legato Component

Legato Component

RTOS Settings

Since the graphics application also needs to be quick, the RTOS Task Delay should be set to 1 ms.

Legato RTOS Configurations

Figure: Legato RTOS Configurations

Back to top


Screen for Quick Test

There is a small project to play with inside the folder pic32mzef_web_photo_frame\dev_files\gfx_test, the file is called GFXTestProject.zip. This can be opened with the Microchip Graphics Composer and can be used to generate the necessary files in the project.

Below are a few steps on how to create this screen.

Microchip Graphics Composer Test Project

Figure: Microchip Graphics Composer Test Project

Opening the Microchip Graphics Composer

The Microchip Graphics Composer is an MPLAB® Code Configurator (MCC) plugin, it can be opened from the Plugins drop-down into the Project Graph window.

Opening the Microchip Graphics Composer Plugin

Figure: Opening the Microchip Graphics Composer Plugin

Back to top


Opening an existing Legato Project

The Legato Composer Project is a zip file that can be kept wherever in the project development files. It is used only for the Composer.

As mentioned, there is a small test project provided for this stage that can be used to see if the setup is working fine.

To open the project, first open the Microchip Graphics Composer from the Project Graph Plugins drop-down.

The Microchip Graphics Composer Wizard will start, click on Load Existing Project.

Loading an Existing Legato Project

Figure: Loading an Existing Legato Project

If the plugin is open, the user can use the Open Project button.

Open a Microchip Composer Project from the tool bar

Figure: Open a Microchip Composer Project from the toolbar

Back to top


Creating a new Legato Project

Open Microchip Graphics Composer from the Project Graph Plugins drop-down.

Choose Create a new project using the new project wizard.

Microchip Graphics Composer Welcome Screen

Figure: Microchip Graphics Composer Welcome Screen

The New Project Wizard will appear.

For fast setup, click Next till the last screen, without changing any option, then Finish.

Below are the steps in the wizard, mainly pre-populated from the MCC project.

Display Configuration

New Project Wizard window Display Configuration

Figure: Display Configuration

Color Mode

New Project Wizard window Color Mode Selection

Figure: Color Mode Selection

Memory Profile

New Project Wizard window Project Memory Profile

Figure: Project Memory Profile

Project Template

New Project Wizard window Project Template Option

Figure: Project Template Option

Finish

New Project Wizard window Finish

Figure: Finish

Back to top


Screens

The new project has a screen with the name Screen0 and a scheme with the name WhiteScheme already created. It also has a panel the size of the screen called BackgroundPanel.

Microchip Graphics Composer

Figure: Microchip Graphics Composer

Click on the panel and delete it.

Empty Screen

Figure: Empty Screen

From the Tool Box, add a gradient with the same size as the screen. Hint, use the Object Editor on the right to position and size the box. The display size is 480x272 pixels, and the position should start from x = 0 and y = 0.

Change its scheme to WhiteScheme from the same Object Editor.

Gradient widget on Screen0

Figure: Gradient widget on Screen0

Now add a Text Field.

Click on the Text Field, its properties should be visible on the bottom right.

Properties can be changed from there. Set the position, size, and scheme, then change the name to “StartScreenLabel”.

Text Field on Screen0

Figure: Text Field on Screen0

To have something written in the text field, a new String and a Font need to be added to the project.

From Asset > Strings, add a new String and put some value inside, like “Hello World”.

String Manager

Figure: String Manager

Then link the Text Field with the String in the Object Editor. Click on the Text Field and in the Object Editor, set the Initial String to the string that was just created.

Object Editor

Figure: Object Editor

Selecting the String for an Object

Figure: Selecting the String for an Object

Using Asset > Font, add any font.

Font Manager

Figure: Font Manager

In Object Editor of the Text Field, select the font.

Now there is something to show.

Play with position and size to reach this:

Figure: “Hello World !” screen

Figure: “Hello World !” screen

From the toolbarclick on Save and save this project somewhere. It will not be needed, so put it into a temporary folder.

Legato Graphics Composer Save Button

Then click on Generate.

Legato Graphics Composer Generate Button

Leave the Composer open.

Go back to MPLAB X IDE and click on Generate from the Resource Management tab.

Program the board and the screen should appear on the TM4301B Display.

TM4301B Display

Back to top