tft display interfacing with microcontroller brands
This note will discuss the considerations made when choosing a microcontroller that will work for your display. A few requirements need to be met depending on the display’s features, interface, and size. These can also be determined by the embedded IC in the display. An overview of the considerations when choosing a microcontroller can be seen below. It should be noted that these items are separated for definition but may serve the same purpose and be interconnected in the ecosystem of the controller.
Application and display specific peripheral requirements. I2C, SPI, UART, Parallel, MIPI, LVDS, HDMI etc. Determines pin connections and required architecture of the device.
Flash and RAM memory requirements. Minimum frame buffer memory is dependent on the size andresolution of the display. Location of memory (external or internal) can restrict interface speed and must becompatible with the chosen interface.
Communication speed requirements defined by the interface and intended application. Refresh rateis determined on the size of the display and location of memory. This will indicate which processors arecompatible.
A displays embedded IC can offer resources such as internal RAM, clock generators and power control.This can save resources otherwise needed to be provided externally. Check the datasheet of the display’s ICcontroller for device function specifics.
Availability of resources for programming and debugging the microcontroller. Online resources andexampleprograms to leverage from can a lot of save time. Compatibility with a familiarprogramming environment isadditionally beneficial.
The interface selection is dependent on the intended application of the display. Each display has a different interface or different choices for a connection interface. For smaller displays a 3/4-wire serial interface would be sufficient. For larger display’s with high resolution a faster interface should be chosen. A parallel RGB interface is capable of high-speed data transmission however requires many pin connections. If the intended application for the display is video a MIPI, LVDS or HDMI connection would be a good choice.
The available memory of a microcontroller often becomes a highlighted issue when determining which microcontroller to select. The microcontroller needs a minimum amount of RAM to hold the frame buffer of the display. Even small displays require more RAM than a typical microcontroller possess. To verify that your microcontroller will have enough memory, it is important to calculate the frame buffer.
The minimum RAM required for the frame buffer in this example would then be 768kB. It is important to note that external RAM can be provided for the frame buffer if the microcontroller does not provide it internally. Clocking speed should be verified if using external RAM as the microcontroller cannot access external RAM as quickly. The clock frequency constrained by external RAM sometimes does not meet the minimum requirements of some very high-speed interfaces (ex. DSI-MIPI). Additionally, the display can contain some form of RAM depending on the IC controller inside the display. This can be verified on the specification sheet of the IC.
The speed of the microcontroller is heavily dependent on the interface used in the application. The minimum and maximum of the clock frequency is specified in the datasheet of the display and in the specification sheet of the display’s controller IC. The frame rate is typically around 50-60Hz, which is the median oscillation frequency to refresh the display to maintain an image. The display will often provide an internal high frequency clock that can be initialized to certain frequencies.
It is important to verify in the controller data sheet which resources are provided by the internal IC of the display. Some key information to look for would be: Does the display have sufficient RAM or does this need to be provided? Does the display have an internal oscillator for clock generation for the interface chosen? An additional graphics controller can be used to interface the display with the microcontroller to meet these requirements. Features like these can be utilized to avoid additional cost, space, and memory of your application.
After a brief consideration of intended application and interface of the display you can get some idea of which microcontroller processor and architecture you will need. There are a few different microcontroller processors to choose from. The main choices are ARM, AVR, PIC, and 8051. The difference between them is the bit size of the processor, 8-bit, 16-bit, 32-bit or 64-bit data . The data bit width is the amount of data that can be sent at a time. This determines the speed of data transfer and thus compatible applications and interfaces.
The AVR has an 8-bit processor and is a RISC type microcontroller. This type of processor is compatible with low speed interfaces (SPI, I2C) and smaller displays. A common AVR microcontroller board is the Arduino which has the embedded 8-bit ATMEL RISC processors. These processors are widely popular which provide the benefit of numerous online resources and availability. The Arduino processors (ATmega/SAM3X) are typically available in most microcontroller programming environments. Additionally, Arduino offers 32-bit AVR development boards which function closely to the ARM processors.
The AVR microcontrollers are constrained by the low frequency, internal memory availability and power costs. AVR’s cannot use external program memory but some may allow expansion of external SRAM. These microcontrollers alone would be incompatible for high frequency applications such as video, large displays, or capacitive touch panels.
The ARM microprocessors have a RISC architecture. They offer 32-bit or 64-bit processors and are great options for high speed interfaces (Parallel, LVDS, MIPI, HDMI) and high-resolution displays. Common ARM processors can be found from STMicroelectronics and Raspberry Pi. The most common version of the ARM processors is the “Microcontroller” Arm-M group which include the Cortex-M0 and Cortex-M4 series.
The ARM processors are compatible with most displays and connection interfaces. These microcontrollers have become increasingly popular, so the cost has become comparable between the ARM and the AVR types. These processors provide the speed, but it is recommended to verify the available RAM as these boards vary widely on included features.
The PIC architecture consists of 8, 16, and 32-bit processors developed by Microchip. The PIC 32-bit series of microcontrollers have been geared toward graphical embedded applications and there are a lot of resources online for these devices. There is a huge variety of PIC controllers which make them easily available. These microcontrollers are known for being low cost and are comparable to the ARM processors. The drawback of the PIC controllers is using Microchips programming environment, but this is based on preference.
The Intel MCS-51, more commonly known as the 8051 microcontrollers have a CISC architecture and an 8-bit processor. These processors differ in architecture from the previous and are programmed using a combination of C and assembly languages. The program memory is read only and does not have an on-board ISP. A special programming device is needed to rewrite the EEPROM or flash memory. These processors are typically small, low cost and low powered. This can make them favorable for battery powered devices. These processors are commonly used to initialize TFT displays and are combined with a graphics controller to provide the required resources such as RAM and clock frequency.
Development environments and online resources become considerably valuable when creating an application for your display. A brand new or uncommon microcontroller will have very few resources for reference. Even knowledgeable engineers can find frustrations with the manufacturers programming environments. There are many microcontroller choices that will support your display with similar and overlapping features. Choosing a microcontroller with an available FAQ, application notes or is accessible on a familiar programming platform can save a lot of time.
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.
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)
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.
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.
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 thedatasheet. 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.
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.
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.
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.
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.
I have a small 3.5 in TFT LCD display from a Chinese manufacturer. It doesn"t have an integrated LCD controller. The documentation claims it is a "16 bit RGB/parallel interface" and it uses a Renesas R61581B0 driver chip.
These types of displays are very common and cheap. They sell for less than $15 a pop on Alibaba.com, but I don"t really have a high esteem for these manufacturers since they do not provide any good / consistent documentation, and their English is riddled with mistakes! But I did get the display, and the product looks and feels like it will do the job!
My question now is, how do I get started ? I have looked on the internet and cannot find a good starting point. I have a 32MHz microcontroller in mind, but I am stumped on how to interface it with the LCD.
Most display projects online that I"ve seen assume that the LCD module comes with an integrated controller , so the MCU"s job becomes pretty simple.. Provide image updates when necessary, and the controller will do the job of refreshing the LCD module at the required 60hz (or so)
This LCD module that I have has raw data lanes that I need to drive myself at 60hz. Are there any good documents on how to interface an MCU directly with such an LCD module?
I"ll be happy with any info that points me in the right direction, whether it be an answer on stackexchange or a reference to any good documentation online.
There are a number of different kinds of displays that can be driven by a microcontroller. This repository contains examples for many of them, along with information about display technologies and some of the more popular libraries for controlling them.
Multi-Segment LED display - There are many models of multi-segment LED displays, including the classic 7-segment LEDs, alphanumeric displays, dot-matrix diplays, bar graph displays, RGB LEDs, and others. What these share in common is that they will have either a common-cathode or common-anode structure. Common cathode LEDs have multiple anodes, one for each LED segment, and one cathode for all. common anode LEDs have a single anode and multiple cathode for all the segments. Driving these displays requires a control pin for each LED segment. They are usually driven by a multiplexer or LED driver, which can provide both a common interface for all the LEDs (such as an SPI or I2C interface), and a controlled current supply for all the LEDs.
Broadcom/Avago’s HCMS-29xx display is multi-segment LED display that has several 5-7 LED matrices with a synchronous serial interface. It has the smallest visibly discrete LEDs in its display that I have encountered.
LCD - Liquid crystal display. LCDs are made up of long-chain molecules in a state between crystal and liquid. When a charge is applied, the molecules align, acting as a polarizer. When paired with a second polarizer, they can either block light or allow it to pass through, appearing either light or dark. A grid of these can form a single-color display. Liquid crystals do not emit light, so a backlight is required to light them up. They come im low-resolution, passive-matrix displays which are usually monochrome or higher-resolution, active-matrix screens which have higher resolution and are usually full color.
OLED - an OLED screen replaces the liquid crystal with a matrix of organic LEDs. This eliminates the need for a backlight, since each pixel generates its own light. For more on OLEDs, see this introduction from ehergy.gov. CNET provides this comparison of LCD vs OLED displays.
ePaper - ePaper displays use a matrix of tiny capsules which are black or colored on one side, and white on the other. Applying a charge to each capsule causes it to turn one way or the other. Unlike LCD or LED displays, ePaper displays maintain their state when powered off. ePaper displays cannot be refreshed as fast as LCD or LED, however. ePaper displays are typically not backlit, and require external lighting. eInk, the primary maker of ePaper displays, has a good FAQ on the technology. Visionect.com has a helpful illustrated explanation as well.
LCD and OLED screens drive their pixels in one of two ways. A passive matrix uses a grid of wires which control each pixel using a row-column scanning method. Voltage is applied to each column in sequence. Then the rows are scanned. If the pixel on that column at a given row should be on, then the row wire voltage is taken low to create a voltage difference, and the pixel turns on. An active matrix uses a grid of thin film transistors (TFT) instead of a row-column scanning apparatus. TFTs allow for greater pixel density and therefore sharper image quality and better response time for each pixel. Jameco offers a good explanation of passive vs. active matrix driver technology.
The oldest form of LCD display, patented in the 1980’s, is known as Twisted Nematic (TN) LCD, and has limits to its viewing angle. Newer LCD technologies such as in-plane switching (IPS) or plane-to-line switching (PLS) afford wider viewing angles and brighter screens.
There are a number of common display driver ICs on the market. Typically a driver IC will be capable of controlling many different sizes and shapes of display, if they are of the same class. For example, you’ll see many TFT displays that use Sitronix’ driver ICs, notably the ST7735 and ST7789. Ilitek’s ILI9225 chip is also common in TFTs. This means that libraries written for one vendor’s display are likely to work for displays from another vendor, if they use the same chipset. This can be convenient, as it means you can sometimes choose the library whose API you find easiest to work with.
Recently, drivers for LEDs have reduced in size to the point where a driver can drive a single pixel. Usually made of three to four LEDs and a single driver, these are very popular with electronics hobbyists. For more on these, see this repository.
Displays for microcontrollers use a variety of control interfaces. The most common are the ones you see for other electronic modules as well: synchronous serial interfaces like I2C and SPI, or asynchronous serial interfaces. also feature parallel interface, requires a large number of I/O pins from your controller.
BUSY - an output pin to indicate that the display controller is busy. connects to whicheve pin the microcontroller has assigned for this function. This pin is less common on TFT displays than on ePaper displays.
Backlight - most TFT screens have a pin which enables or disables the backlight of the screen. The naming for this is not standardized: BLK, LITE, TE are all in use. Read the module’s datasheet for details.
Note: the electronics industry has used the terms “master/slave” to refer to controller devices and peripheral devices for decades without regard for the historical context of, and offense caused by, those terms. As a result, you will see the terms MOSI/MISO/SS in data sheets to refer to the pins of an SPI device While a modern standard naming scheme has not yet emerged to replace these, there are proposals in discussion. The Open Source Hardware Association has this proposal, for example. Make Magazine has this proposal. The debate is not resolved, and you will likely see some variations on the terms. The SDO, SDI, and SCK terms are the most widely accepted terms with the least historical baggage, but unfortunately, it’s still necessary to be aware of the other possible terms for pins in SPI.
Hitachi HD44780 LCD display. See the Arduino LiquidCrystal library. These 2x16 character LCD displays are ubiquitous in the hobbyist market and come in many starter kits for the Uno. They are a passive-matrix LCD with a parallel interface (6 pins) that runs on 5 volts. They will typically not run on 3.3 volts. Each character is a 5x7 pixel matrix, so these are very low-resolution displays. They can usually be foung for $10-$15, which was a bargain in the early Arduino days. Nowadays, if you need an inexpensive 2-line display, some of the OLED displays like the SSD1306 are a better bargain.
There are some display modules which have an asynchronous serial (UART) interfaces. These typically have a microcontroller on the display module itself, which is interfacing with one of the types of interfaces above. These modules typically have a communications protocol that is unique to the vendor. They are convenient, but more expensive than their synchronous serial or parallel counterparts.
Finding the right display library for your Arduino or Arduino-compatible display can be challenging. Vendors who design and sell their own breakout boards tend to publish libraries that are compatible with their own boards. Smaller vendors may not make their own libraries, relying on third-party libraries instead. The Arduino site lists over 300 display-related libraries. The ease-of-use and adaptability of those libraries varies widely. The ones I’ve found most useful are Adafruit’s GFX library and Oli Kraus’ U8g2 library.
Since there is a relatively small number of driver chip manufacturers (Hitachi, Ilitek, Solomon-Systech, and Sitronix among them), different vendors’ boards often use the same driver hardware. This means that the libraries from one vendor can support the hardware from another. When you shop for displays, it’s worthwhile to check what the driver is for each one, and see if there’s a compatible library from your favorite library writer.
Adafruit_GFX is a hardware-independent graphics library written to work with all the Arduino-compatible displays that Adafruit sells. They complement this with display specific libraries like Adafruit_SSD1306 for SSD1306 OLED libraries, Adafruit_EPD for ePaper displays, Adafruit_ST7735 for some TFT libraries, and others. The advantage of the GFX library is that you get a common drawing API regardless of which display you’re using. It uses the Arduino Printable interface too, so commands like print() and println() work with this library just like they do in the serial monitor. There’s a good guide to the GFX library as well. Sparkfun’s got their own complement to the GFX library, Hyperdisplay.
u8g2 is designed as a universal library for many different displays. It supports a wider range of displays than any other I’ve used so far. It has its own graphics API which is more or less similar to Adafruit’s, and a wide font set as well. There’s also U8g2_for_Adafruit_GFX, a library which allows you to add U8g2 fonts to any Adafruit_GFX-based library.
The display is a critical component in every project, impacting the case, firmware, electrical design, user interface, and even battery life. For these reasons, and because it is the most visible component of your product, it must be approved by the mechanical design team, management and marketing.Before these teams can approve, they need to see it in action. But it can take days or weeks to connect a display to your platform, initialize it and build a code library able to create believable demonstrations. Meanwhile, the whole project is on hold.Our 8051 development kit / demonstration board can solve this problem. Use it to get the display seen, demonstrated and approved for your project.
ER-DBTM080-2 is a microcontroller 8051(80C51) demonstration and development kit for ER-TFTM080-2 product that is 8 inch tft lcd display with RA8875 controller board.The kit includes MCU board controlled by STC12LE5A60S2,ISP(In System Programming) with USB port and cable to customize the demonstration that includes your own bitmap images,personalized fonts,symbols,icons and burn sketches,microSD card that is written graphic and text into it,the power adaptor,the adaptor board with various pitch dimension used to connect MCU board and display.Optional for 8080 8/16-bit,6800 8/16-bit parallel interface and I2C,3-wire,4-wire serial interface.
This library is a professional graphical stack library to build Graphical User Interfaces (GUIs) with any STM32, any LCD/TFT display and any LCD/TFT controller, taking advantage of STM32 hardware accelerations whenever possible.
The STemWin Library is a comprehensive solution that comes with a rich feature set, such as JPG, GIF and PNG decoding, many widgets (checkboxes, buttons…) and a VNC server enabling the remote display of local displays, as well as professional development tools, such as GUIBuilder to create GUIs with a simple drag and drop.