Display Driver for SSD1963 Controller - automaate/GFX_sandbox GitHub Wiki

Microchip Technology QuickStart Display Driver for SSD1963 Controller

This guide describes the basic steps to generate display driver for the SSD1963 display controller.

Who should use this guide

This guide is intended for developers who are building applications on boards using the SSD1963 display controller and a LCD display module.

What this guide contains

You will build a simple application that displays an image and touch button. It starts with the creation of a new MPLAB® project and finishes with a graphics application equivalent to legato_quickstart. Here are the primary steps to create a graphics application for your SSD1963 display controller:

  1. Create a new project and configure clock for SAMe70.
    • Create MPLAB Harmony v3 Project using MPLAB X IDE
    • Verify Clock Settings
  2. Configure Harmony components for graphics middleware and drivers
  3. Configure pins for external graphics communication
  4. Generate Code
  5. Add application code to project
  6. Build, program and observe outputs
Materials you will need

Reference Application:

Reference Hardware:

Creating New Project Tutorial Steps

  1. Create an MPLAB Harmony Project for the target board. Make sure to include the gfx package when creating the project.

  2. In the MPLAB Harmony Configurator, add the Graphics -> Middleware -> Legato component.

  3. Next, add the Graphics -> Driver -> LE External Controller component. The LE External Controller component provides configuration options for generating a Legato graphics-compatible driver for an external display controller. Connect the LE Display Driver node of LE External Controller to the same node in Legato.

  4. To satisfy the SYS_TIME dependency of the LE External Controller component, add Harmony -> System Services -> TIME.

This will also activate the Harmony Core component, so click YES when prompted.

This tutorial will not use FreeRTOS, so click NO when prompted whether to activate FreeRTOS.

Harmony Core and TIME System Service should now be active in the Project Graph.

  1. To satisfy the TMR dependency of the TIME System Service component, add Peripherals -> TC – TC0 and connect the TMR node of TC0 to TMR node of TIME.

  2. Select the LE External Controller component in the Project Graph to show the Configuration Options.

a. The Base Driver option allows you to start with a bare driver or an ILI9488 or SSD1963-compatible driver. Selecting an ILI9488 or SSD1963-compatible base driver will set the configuration options for those controllers which you can then modify to match your specific controller configuration. For this tutorial, we’ll start with a bare driver, so keep the Base Driver option set to Custom.

b. The Controller option allows you to set the controller name. The value will be used to prefix the functions used in the generated driver code, so only use C-compatible strings (e.g., no special characters or spaces). This tutorial will create a driver for the SSD1351 part, so we’ll set the Controller option to SSD1351.

c. The Display Interface Type option lets you select a Parallel 8080 or a SPI 4-line interface. The SSD1351 connects to the PIC32MZ EF MCU thru the SPI 4-line interface, so select SPI 4-line for the Display Interface Type.

Observe that the Display Interface on the LE External Controller component has changed from Parallel to SPI Display Interface. Later in this tutorial, we will activate the components that this interface requires.

d. Next, in the LE External Controller options, set the Display Settings to Width = 96 and Height = 96 to match the display resolution.

e. The default Reset Settings should work for the SSD1351, so let’s keep the default Reset Settings without changing them. For other controllers that require different reset duration and delay, set the appropriate periods here.

f. The Initialization Settings allows you to put in the commands and parameters needed to initialize the display controller. The maximum number of commands is 32 and each command can take up to 16 parameters.

For a very basic initialization of the SSD1351 controller, we will put in 4 initialization commands. Set the Number of Init Commands to 4. Observe that there are now 4 commands CMD[0 – 4] that you can put in to initialize the controller.

g. Put in the command value and parameters in each of the initialization command CMD[x]. For each command, you can put in a comment to describe what the command does, add a delay after the command is sent, set the number of parameters and the value of each parameter.

For the SSD1351 controller on the Mikro OLED C display, the following initialization command and parameter values are set in the component options.

The commands above are for basic initialization of the display. More commands may be added to configure the display for other functions.

h. Next, the Blit Buffer Function Settings provide options to configure the way the driver writes the frame data out to the external display controller. It supports common 16- and 8-bit write formats for frame data.

If the target controller uses a format that cannot be supported by the driver, the Blit Buffer Function Generation Mode allows an option to generate a Stub function, where it will generate an empty blit function for users to write in the code to send the frame data.

For the SSD1351, we’ll use the Bulk Write function, set the Pixel Data Write Size to 8 bits and the Pixel Data Transfer Size to 2(Normal). Pixel Data Transfer Size allows other options for controllers that use other 8-bit write formats such as 2-byte little endian or 3-byte writes.

i. Next, the SSD1351 only requires 1-byte for the Column/X and Row/Y address values, so the X/Y Address Size option is set to 1-byte.

j. The Set Column/X Command, Set Page/Y Command and Memory Write Command are set to 0x15, 0x75, 0x5C to match the commands for the SSD1351. A Column/X Offset of 16 is also set as this is required for the Mikro OLED C display.

Now, we are done configuring the External Controller component. Let’s complete the rest of the Harmony project configuration.

  1. The LE External Controller component requires the SPI Display Interface. Add the Graphics -> Interface -> LE SPI 4-line component to the project and connect SPI Display Interface nodes of the LE SPI 4-line component to the same node in LE External Component.

  2. Next add the Harmony -> Drivers -> SPI component and connect the DRV_SPI node to the LE SPI 4-line component.

  3. Now, add the Peripherals -> SPI -> SPI1 component to the project and connect it to the SPI Driver component. The SPI Peripheral Library component will configure the SPI peripheral that drives the SPI interface on the Mikro BUS 1 header on the PIC32MZ Curiosity 2.0 board.

  4. In MHC, open Tools -> Pin Configuration. Let’s configure the following pins needed for the SPI 4-line interface to the Mikro OLED C display. a. Set Pin 9 RJ12 to GPIO, OUT, HIGH. This pin drives the reset signal, set Name as GFX_DISP_INTF_PIN_RESET.

b. Set Pin 49, RJ12 to GPIO, OUT, LOW. This pin drives the R/W signal to the display, set Name as GFX_DISP_INTF_PIN_RW. This pin is not used for SPI 4-line and must be pulled LOW.

c. Set Pin 58, RF12 to GPIO, OUT, HIGH. This pin drives the ENABLE signal to the display, set Name as GFX_DISP_INTF_PIN_ENABLE. This pin is not used for SPI 4-line and must be pulled HIGH.

d. Set Pin 70, RD15 to GPIO, OUT, HIGH. This pin drives the D/C# (Data/Command) signal to the SSD1351, set Name as GFX_DISP_INTF_PIN_RDSC.

e. Set Pin 97, RD9 to GPIO, OUT, HIGH. This pin drives the CS# (Chip Select) signal to the SSD1351, set Name as GFX_DISP_INTF_PIN_CS.

f. Set Pin 109, RD1 Function to SCK1. This pin drives the SPI CLK signal to the SSD1351.

g. Set Pin 121, RD7 Function to SDO1. This pin drives the SPI SDIN/D1 signal to the SSD1351.

  1. Next in MHC, launch Tools -> Legato Graphics Composer to design the screen.

  2. When done composing the screen, go back to MHC and generate the project code. Compile and Run the code on the target to see the screen on the display.

The demonstration will render the following image on the display:

The following image should appear on the display:

Microchip Technology

⚠️ **GitHub.com Fallback** ⚠️