1.8” TFT and TI MSP-EXP432P401R Microcontroller - FAN4204
1.8” TFT and TI MSP-EXP432P401R Microcontroller
This application note discusses how to setup a 1.8” TFT display with a TI microcontroller.
The display used in this project is a 1.8” TFT with 128x160 pixels of resolution. The microcontroller used is the SimpleLink MSP-432P401R from Texas Instruments. The TFT display will be interfaced with the microcontroller via a 4-wire serial connection and programmed using the Energia IDE platform.
In just a few steps the TFT can be wired and programmed to display up to 65K colors and 128x160 pixels of resolution. The display can be powered from the 3.3V output of the TI. Various wiring and interface options are available, from 3-4 wire serial, to 16/18-bit RGB and 8/9/16/18-bit MCU parallel. Additional features of this display are below. As always, check out the data sheet for the specs of this specific display. (datasheet)
- 45 pins, 34.0x47.0 mm
- 128(RGB)x160 pixels, TN
- ILI9163 controller
- White LED Backlight
- Transmissive/Normally White
- Serial and Parallel interfaces
- 3.3V (TYP)
2. What You'll Need
First you will need to download the Energia IDE software if you have not already. This IDE was chosen because of the similarities is has to the Arduino IDE. This is beneficial because there is a large variety of open sourced examples that demonstrate the features of this display. An alternative programming IDE is Code Composer Studios, which is also compatible with the TI microcontroller. The IDE is up to preference. We will come back to this after the hardware is setup.
Below is a list of the physical materials you will need to setup the project.
|1||TI MSP-432P401R microcontroller with micro-USB Cable||TI|
|1||E17RG11216LW6M300-N 1.8” TFT display|| Focus LCDs
|1||45-pin FPC connector board 0.5 mm pitch|
|1||Male-to-Male Jumper Wires|
Figure 1: TFT Ribbon to FPC Pin Assignment
There are only a few connections that need to be made between the display for the 4-wire serial interface. The unused parallel data pins will be pinned to GND. Consult the datasheet for a detailed explanation of each pin assignment and their functions. The 4-wire serial data pins are connected to the TI specific serial inputs for the “Hardware SPI” programming option. While any pins can be used, their location must be defined in the “Software SPI” programming option.
4. Pin Assignments
Pin definitions and connection points are described in the table below. We will use the 4-wire serial interface for this example to save data pins on the TI. A more in-depth description of each of the pins can be found on the datasheet. All unused pins are connected to ground, with the exception of the reset pin. This pin is optional to connect to the TI, if not used it needs to be pulled high.
The TI microcontroller has dedicated serial input pins specific to the board. The pin locations can be seen below and are described in the table for how they are connected to the display. These and other hardware pin definitions can be verified on the TI website.
Figure 2: TI MSP-432P401R Serial Hardware Pin Definitions
After the screen is connected, and the TI microcontroller is plugged into the computer you will see the white LED backlight come on. That is a good sign that things are connected correctly.
5. Programming the TI
Now it is time to program the microcontroller. For this example, we will be using the Energia IDE. An alternative platform that can be used is Code Composer Studios. I have found that Energia IDE is more practical for this example because of the compatibility with Arduino specific code with only minor changes.
We will need a program for the specific display chip “ILI9163”. For this example, I have created a modified version of a popular Adafruit example that demonstrates the various capabilities of the display. The example can be downloaded from Github here.
You will also need to include Adafruit’s GFX library which can be downloaded here. This is a popular library that contains examples and features for TFT displays that prove to be useful for this application.
Once these libraries are downloaded, add them to the Energia documents file. You should see the example as below:
Hardware or software definitions are available. The wiring is set up so that the 4-wire SPI pins are at the correct location for the hardware definition. The hardware option is much faster than the software and is the recommended option.
The example in the image above is using the software declaration of the data pins connected to the TI board. Verify that these values are correct as shown above.
You can now test any of these various programs that might be good reference for your specific project. There a lot of good examples in the Adafruit GFX library as a resource to test the various capabilities of the display.
The example is a good first program to run just to see if everything is connected correctly and to test the graphics. Some pictures of the example are shown below.
This 1.8” TFT is a good option for displaying 16-bit 65K color images. This is compatible with most microcontrollers as it saves on-board memory. This is beneficial for storing bitmaps on flash memory since the screen is small and the 65K color bitmap image won’t take up all the on-board storage on the TI. This display also has a version with a resistive touch screen. This would be a good option for a digital push button. This may be further discussed in a future application note.
Buyers and others who are developing systems that incorporate FocusLCDs products (collectively, “Designers”) understand and agree that Designers remain responsible for using their independent analysis, evaluation and judgment in designing their applications and that Designers have full and exclusive responsibility to assure the safety of Designers' applications and compliance of their applications (and of all FocusLCDs products used in or for Designers’ applications) with all applicable regulations, laws and other applicable requirements.
Designer represents that, with respect to their applications, Designer has all the necessary expertise to create and implement safeguards that:
(1) anticipate dangerous consequences of failures
(2) monitor failures and their consequences, and
(3) lessen the likelihood of failures that might cause harm and take appropriate actions.
Designer agrees that prior to using or distributing any applications that include FocusLCDs products, Designer will thoroughly test such applications and the functionality of such FocusLCDs products as used in such applications.