graphic lcd display programming factory
Do you need help getting started with your graphic LCD and CFA10110 adapter board? This getting started guide helps bring up any of the following displays or kits:
If you need a guide for the CFAG12864T3 or CFAG12864U3 using a generic breakout board, check out this getting started guideor our DIY transparent display video. Speaking of videos, click here if you’d prefer this bring up guide as a video.
The family of U3 and T3 monochrome graphic LCD displays are great because they’re low power, thin, easily readable, and quick to develop with. The U3 family is 2.2″ on the diagonal, while the T3s are 1.1″. Versions with “TFH” in the part number include a frame backlight that makes these displays readable in dark environments while the “NFH” displays are reflective and rely on external light sources.
These graphic LCDs are a great way to provide low-fuss information in a project. They can display any shape you want, so no worrying about an included font table not including necessary characters. Plus, they’re quicker to develop for than a full color TFT display. They have extremely low power requirements, especially if the backlight is selectively used. They can even be converted to create a DIY transparent display.
We designed the CFA10110 adapter board for these displays to further simplify incorporating these displays. The board breaks the tail out to a 16-pin 0.1″ header, so no soldering is necessary to connect to the display. Further, 2 x 2-56 threaded mounting standoffs make securing this display module a breeze. And jumpers on the board handle switching between SPI and parallel interfaces.
This guide will walk through setting up the display with a CFA10110 in SPI mode. Wiring information for the parallel modes can be found in the datasheets available in the righthand sidebar of the product pages or in the demo code.
If you ordered the CFA10110 separately from the display, insert the tail of the display shiny pins down into the ZIF connector. You shouldn’t need a lot of force to insert the tail into the connector (thus “Zero Insertion Force”).
The final step is to run a sketch. Connect your controller to your computer with the USB cable and upload your sketch. If you’re using our sketch, check that the display defined in LCD_low.h is the same as the display you just wired up. It changes the contrast and a few other settings and can make the display difficult to read if the wrong one is defined. The section that needs to be checked looks like this:
The Graphic LCD Interface (GraphicLCDIntf) Component provides the interface to a graphic LCD controller and driver device. These devices are commonly integrated into an LCD panel. The interface to these devices is commonly referred to as an i8080 interface. This is a reference to the historic parallel bus interface protocol of the Intel 8080 microprocessor.
This Component is designed to work with the SEGGER emWin graphics library. This library provides a full-featured set of graphics functions for drawing and rendering text and images. The emWin graphics library is available for the following devices:
The 32128A is our smallest standard monochrome graphic LCD module. This LCD is ideal for remote controls and hand held products, as well as for applications that require a small, high-resolution display. The COG IC is the Sitronix ST7565V. This LCD has a FPC interface.
The ST7565V is a single-chip dot matrix LCD driver that can be connected directly to a microprocessor bus. 8-bit parallel or serial display data sent from the microprocessor is stored in the internal display data RAM and the chip generates a LCD drive signal independent of the microprocessor.
The 128240D is our largest standard monochrome graphic LCD. The viewing area is 92 x 53 mm and offers grey-scale performance. This LCD module is most commonly paired with a white LED backlight.
The ST7529 is a driver & controller LSI for 32 gray scale graphic dot-matrix liquid crystal display systems. It generates 255 Segment and 160 Common driver circuits. This chip is connected directly to a microprocessor, accepts Serial Peripheral Interface (SPI), 8-bit/16-bit parallel or IIC display data and stores in an on-chip display data RAM. It performs display data RAM read/write operation with no external operating clock to minimize power consumption. In addition, because it contains power supply circuits necessary to drive liquid crystal, it is possible to make a display system with the fewest components.
The Dot Factory is a small open source tool (MIT licensed) intended to generate the required C language information to store many fonts and images, as efficiently as possible, on a microcontroller. These fonts are then uploaded via the LCD driver (see the Drivers and Modules page for a few) to the actual dot matrix LCD. It is written in C# for Visual Studio 2008 and has been tested on Windows XP, 2003, Vista, 7 and Linux via Mono.
Working with dot matrix LCDs with microcontrollers, while not difficult, is tedious. The actual LCD controller allows us to upload simple visual data (dot on or dot off) into the LCD’s dot matrix, but not much else. It is up to our software to decide what to upload when we want to draw lines, circles and more importantly – text.
While there are software graphic libraries that allow us to generate a character “on the fly” using vector graphics (the character is described as a series of drawing commands that allow scaling and decoration) – these are much too complex and large to integrate in a microcontroller environment. Consequently, we must store the exact appearance of a character as a series of 1s and 0s, equivalent to a “dot on” “dot off” on the LCD, and upload this as a bitmap when we want to display text. While it is possible to generate this manually, it is desired to have a tool to do our grunt work by converting windows fonts (given a size and decoration) into a series of bitmaps.
TDF is comprised of two panes – the input pane on the left (what you want to generate) and the output pane on the right (the generated output, in C code). The input pane can accept either a font of your choice (for writing text to the LCD) or an image. When generating a font, you have the option of either generating all the available letters (by selecting “All” in the Insert Text box and clicking the plus button) or by typing in which letters, numbers or symbols you are actually using in your application (for example: 0123abcd). If you are writing a simple application that has only a few sentences, you can type them wholly in this box without fear of duplicating letters – TDF takes care of that by discarding any duplicates. This way only the letters you use will take up space.
Once you have completed setting up what it is you’d like to generate (be it an image or font), select the output method in the output pane. If you are using the LCD drivers on this website, you want it to generate an MSb first output, otherwise images will come out wrong. If you have a compiler that supports the “0b” binary specifier, you can select “binary” rather than “hex”. This will allow you to visually see the pixels you will set and allow for manual touch up by the user without having to calculate hex and experimentation. Click generate and your C code will be outputted to the text box below. Copy paste this into your application (it is recommended to put this in a separate module, not your LCD driver module, for organizational reasons).
The character bitmap array: This holds the actual characters as a bitmap (only the characters selected in the input pane). Each byte represents a single vertical page sent to the LCD. All vertical padding is removed from the characters
The character descriptor array: Allows O(1) mapping between a character’s ASCII value and required meta information about the character – namely its width in bits and its offset into the character bitmap array. When the LCD driver needs to find where character X is located in the bitmap array, it will jump to index [X - font.startCharacter] in the descriptor array. The startCharacter is the first character (that is, the character with the lowest ASCII value) used for this font. By defining a startCharacter we can reduce the number of elements in the descriptor array.
The font information: This element is essentially the font descriptor for this font. It holds information regarding this font like the name of the character bitmap and descriptor arrays, the font start character and how many pixels wide a space character is for this font. The LCD driver will replace the space character with empty pixels (this saves both processing time, space in the character bitmap array and space in the character descriptor array – since the space is the first ASCII character and is commonly used).
Version 0.0.7 (28may10): Added ability to select whether character descriptor array is to be created and which character will be used to visualize the font (thanks Christian Treczoks), syntax coloring automatically disabled when generating large amounts of text (will be fixed properly next version), properly handled bitmaps with no black pixels in them (displays error instead of a crash), some minor cosmetics
Have you ever asked yourself what LCD is? No worries, we are here for you. Therefore, like in any display gadget, liquid crystal display coordinates with a microprocessor or microcontroller. The MCPU and MCU send the brightness that every pixel should produce. It creates the required color of the pixel for your LCD screen.
However, the mode of communication between the MPU/MCU and an LCD segment is known as the interface. We shall discuss more of the LCD interface in this guide.
The LCD interface is a link between the flat panel display module and the multimedia processor. Therefore, the interface can be separated or incorporated as part of the structure on the chip. Additionally, the application produces an image, and then the screen displays it using an LCD interface for the user.
Besides, the serial peripheral interface has another component known as the slave select (SS) or chip select. The function of the SS is to wake the peripheral to receive or send data. For instance, since the SPI can support several peripherals, the SS can wake particular peripherals instead of all. Finally, you can use the SPI in graphic, character, digit, and small TFT LCDs. It allows simple interfacing, affordable hardware, and faster speeds than in the SCI.
It is another serial interface in LCDs that resembles the SPI with slave, clock functions, and master. The I²C does not integrate the SS line as in SPI. Therefore, a process known as addressing is essential in selecting a slave to communicate. A frame of the signal is sent on the data bus to address a specific slave after the first bit. Nevertheless, the output signal gets to every slave connected with, although only the slave with the corresponding address to the signal will receive the message.
Additionally, in MCU parallel interface for Liquid Crystal Displays, data signals are sent through data lanes on either 18-bit, 16-bit, 9-bit, or 8-bit data channels. Besides, the MCU interface is simple, although it requires a display RAM for its memory functionality. Also, you can use it in graphic LCDs, character LCDs, and small TFT LCDs.
LVDS is an acronym for Low-Voltage Differential Signaling. This type of interface is essential as a complement for large LCDs and peripherals that require high bandwidth, such as HD graphics and fast frame rates. Therefore, it is a good choice due to its fast data transmission while consuming low voltage. One of the LVDS interface wires carries the precise inverse of its companion. Additionally, the electric charge from one wire is correctly masked by the other wire, reducing the interference to the wireless system nearby. Finally, at the recipient end, a circuit checks the variation in voltage between the two wires.
Red Green and Blue (RGB) interface functions are to link with color displays. It transmits 8 bits of data for each of the colors in every clock oscillation. Therefore, this means there are 24 bits of data sent for every clock oscillation.
Currently, you must have seen an improvement in terms of performance as electronic devices become smaller and easy to use. Therefore, this has led to the introduction of an embedded display port. The interface connects a video device to a display device and carries USB, audio, and other data forms. Moreover, this display port offers a high-performance external A/V interface hence high display resolutions of 4K. Additionally, the motive behind the development of this interface is due to several computing requirements. First of all, the main requirement is hardware integration.
This is a new technology development from the MIPI alliance. Mobile Industry Processor Interface has become a preferred option for mobile developers. This interface uses the same signaling as in LVDS. It uses a clock pair and 1-8 data lanes. Mobile Industry Processor Interface supports complex rules that allow low power and high-speed modes. Additionally, it reads data coming from the display at low rates.
When choosing the correct display interface for your device, you need to consider several factors. Therefore, it requires you to know how to connect the display to your electronic system. Nevertheless, it would be best if you choose the correct interface for your display. Additionally, consider the amount of data transferred and the refresh rate your system requires.
Finally, we have made it easier as we have given you all the details on each display interface, including the pros and cons. Therefore, having gone through our guide, you will never have issues when making your choice.
Established in 1998, Winstar Display Co., Ltd. is a reliable LCD Display Module Manufacturer and LCD Panel Supplier. Winstar has development of high-quality display module products. We operate worldwide, configure, service products, and also provide logistics support to deliver products and services competitively. We provide LCM Modules including monochrome TN/STN/FSTN LCM, COG LCD, TFT LCM / TFT panels, FSC-LCD, graphic LCM, character LCD displays, OLED display modules (PMOLED), custom LCD displays, OLED and LCD panel.
WG12864B is a mono 128x64 graphic LCD display, diagonal size 2.4 inch. WG12864A model is built in with NT7108 controller or equivalent IC; it supports 6800 8-bit parallel interface. This WG12864B 128x64 LCD module is 5V power supply. If you need negative voltage 3.3V power supply, please choose WG12864BP1. This 12864 Graphic LCD module is available for without backlight or with LED backlight options. WG12864B is available in various LCD panel colors including gray, yellow/green and blue LCD options. This model graphic LCD display can be operating at temperatures from -20℃ to +70℃; its storage temperatures range from -30℃ to +80℃.
NHD-12864WG-BTMI-V#N | Monochrome Graphic Module | 128x64 Pixels | Transmissive LCD | White Backlight | STN (-) Negative Blue Display | Built-in Negative Voltage
Newhaven 128x64 graphic Liquid Crystal Display module shows white pixels on a dark blue background. This transmissive LCD Display requires a backlight for visibility and offers a wide operating temperature range from -20 to 70 degrees Celsius. This NHD-12864WG-BTMI-V#N display includes built-in negative voltage. It has an optimal view of 6:00, operates at 5V supply voltage and is RoHS compliant.
Easily modify any connectors on your display to meet your application’s requirements. Our engineers are able to perform soldering for pin headers, boxed headers, right angle headers, and any other connectors your display may require.
Choose from a wide selection of interface options or talk to our experts to select the best one for your project. We can incorporate HDMI, USB, SPI, VGA and more into your display to achieve your design goals.
If we use 14 pins for GLCD, pins left for other tasks = (17-14) = 3. That is impractical for any application. So effectively, we could as well decide not to use 28-pin device for GLCD.
Another issue is that, if your controller is 3.33V, you will have to read the LCD data sheet and make sure that the VIH and VIL are OK for 3.33V inputs.
I was inspired with the 2 wire -- clock and data scheme using 74HC595 very famous to drive character LCD. Please refer to this link (Bill"s version): -
1. Only 2 wires required ( additional 2 wires for 5V and GND). There are 1 wire version as well for LCD interface, but that is more complex. If we extrapolate the trend, we could also achieve 0-wire scheme (say by using bluetooth), but that is even more complex.
Click on the image to see a zoomed version. The 20-pin header is the one that will fit with connector on LCD module. Pleas refer to the LCD module data sheet (bottom of web page) to know the pin description of LCD module.
ESP chips can generate various kinds of timings that needed by common LCDs on the market, like SPI LCD, I80 LCD (a.k.a Intel 8080 parallel LCD), RGB/SRGB LCD, I2C LCD, etc. The esp_lcd component is officially to support those LCDs with a group of universal APIs across chips.
In esp_lcd, an LCD panel is represented by esp_lcd_panel_handle_t, which plays the role of an abstract frame buffer, regardless of the frame memory is allocated inside ESP chip or in external LCD controller. Based on the location of the frame buffer, the LCD panel allocation functions are mainly grouped into the following categories:
esp_lcd_rgb_panel_config_t::clk_src selects the clock source for the RGB LCD controller. The available clock sources are listed in lcd_clock_source_t.
esp_lcd_rgb_panel_config_t::bits_per_pixel set the number of bits per pixel. This is different from esp_lcd_rgb_panel_config_t::data_width. By default, if you set this field to 0, the driver will automatically adjust the bpp to the esp_lcd_rgb_panel_config_t::data_width. But in some cases, these two value must be different. For example, a Serial RGB interface LCD only needs 8 data lines, but the color width can reach to RGB888, i.e. the esp_lcd_rgb_panel_config_t::bits_per_pixel should be set to 24.
esp_lcd_rgb_panel_config_t::sram_trans_align and esp_lcd_rgb_panel_config_t::psram_trans_align set the alignment of the allocated frame buffer. Internally, the DMA transfer ability will adjust against these alignment values. A higher alignment value can lead to a bigger DMA burst size. Please note, the alignment value must be a power of 2.
esp_lcd_rgb_panel_config_t::bounce_buffer_size_px set the size of bounce buffer. This is only necessary for a so-called “bounce buffer” mode. Please refer to Bounce Buffer with Single PSRAM Frame Buffer for more information.
esp_lcd_rgb_panel_config_t::timings sets the LCD panel specific timing parameters. All required parameters are listed in the esp_lcd_rgb_timing_t, including the LCD resolution and blanking porches. Please fill them according to the datasheet of your LCD.
esp_lcd_rgb_panel_config_t::fb_in_psram sets whether to allocate the frame buffer from PSRAM or not. Please refer to Single Frame Buffer in PSRAM for more information.
esp_lcd_rgb_panel_config_t::double_fb sets whether to enable the double frame buffer mode. Please refer to Double Frame Buffer in PSRAM for more information.
Most of the time, the RGB LCD driver should maintain at least one screen sized frame buffer. According to the number and location of the frame buffer, the driver provides several different buffer modes.
This is the default and simplest and you don’t have to specify flags or bounce buffer options. A frame buffer is allocated from the internal memory. The frame data is read out by DMA to the LCD verbatim. It needs no CPU intervention to function, but it has the downside that it uses up a fair bit of the limited amount of internal memory.
If you have PSRAM and want to store the frame buffer there rather than in the limited internal memory, the LCD peripheral will use EDMA to fetch frame data directly from the PSRAM, bypassing the internal cache. You can enable this feature by setting the esp_lcd_rgb_panel_config_t::fb_in_psram to true. The downside of this is that when both the CPU as well as EDMA need access to the PSRAM, the bandwidth will be shared between them, that is, EDMA gets half and the CPUs get the other half. If there’re other peripherals using EDMA as well, with a high enough pixel clock this can lead to starvation of the LCD peripheral, leading to display corruption. However, if the pixel clock is low enough for this not to be an issue, this is a solution that uses almost no CPU intervention.
The PSRAM shares the same SPI bus with the main Flash (the one stores your firmware binary). At one time, there only be one consumer of the SPI bus. When you also use the main flash to serve your file system (e.g. SPIFFS), the bandwidth of the underlying SPI bus will also be shared, leading to display corruption. You can use esp_lcd_rgb_panel_set_pclk() to update the pixel clock frequency to a lower value.
To avoid tearing effect, using two screen sized frame buffers is the easiest approach. In this mode, the frame buffer can only be allocated from PSRAM, because of the limited internal memory. The frame buffer that the CPU write to and the frame buffer that the EDMA read from are guaranteed to be different and independent. The EDMA will only switch between the two frame buffers when the previous write operation is finished and the current frame has been sent to the LCD. The downside of this mode is that, you have to maintain the synchronization between the two frame buffers.
This mode allocates two so-called bounce buffers from the internal memory, and a main frame buffer that is still in PSRAM. This mode is selected by setting the esp_lcd_rgb_panel_config_t::fb_in_psram flag and additionally specifying a non-zero esp_lcd_rgb_panel_config_t::bounce_buffer_size_px value. The bounce buffers only need to be large enough to hold a few lines of display data, which is significantly less than the main frame buffer. The LCD peripheral will use DMA to read data from one of the bounce buffers, and meanwhile an interrupt routine will use the CPU DCache to copy data from the main PSRAM frame buffer into the other bounce buffer. Once the LCD peripheral has finished reading the bounce buffer, the two buffers change place and the CPU can fill the others. The advantage of this mode is that, you can achieve higher pixel clock frequency. As the bounce buffers are larger than the FIFOs in the EDMA path, this method is also more robust against short bandwidth spikes. The downside is a major increase in CPU use and the LCD CAN’T work if the cache is disabled by flash operations, e.g. OTA or NVS write.
Note that this mode also allows for a esp_lcd_rgb_panel_config_t::bb_invalidate_cache flag to be set. Enabling this frees up the cache lines after they’re used to read out the frame buffer data from PSRAM, but it may lead to slight corruption if the other core writes data to the frame buffer at the exact time the cache lines are freed up. (Technically, a write to the frame buffer can be ignored if it falls between the cache writeback and the cache invalidate calls.)
This mode is similar to the Bounce Buffer with Single PSRAM Frame Buffer, but there is no PSRAM frame buffer initialized by the LCD driver. Instead, the user supplies a callback function that is responsible for filling the bounce buffers. As this driver does not care where the written pixels come from, this allows for the callback doing e.g. on-the-fly conversion from a smaller, 8-bit-per-pixel PSRAM frame buffer to an 16-bit LCD, or even procedurally-generated frame-buffer-less graphics. This option is selected by setting the esp_lcd_rgb_panel_config_t::no_fb flag and supplying a esp_lcd_rgb_panel_config_t::bounce_buffer_size_px value. And then register the esp_lcd_rgb_panel_event_callbacks_t::on_bounce_empty callback by calling esp_lcd_rgb_panel_register_event_callbacks().
It should never happen in a well-designed embedded application, but it can in theory be possible that the DMA cannot deliver data as fast as the LCD consumes it. In the ESP32-S3 hardware, this leads to the LCD simply outputting dummy bytes while DMA waits for data. If we were to run DMA in a stream fashion, this would mean a de-sync between the LCD address the DMA reads the data for and the LCD address the LCD peripheral thinks it outputs data for, leading to a permanently shifted image.
In order to stop this from happening, you can either enable the CONFIG_LCD_RGB_RESTART_IN_VSYNC option, so the driver can restart the DMA in the VBlank interrupt automatically or call esp_lcd_rgb_panel_restart() to restart the DMA manually. Note esp_lcd_rgb_panel_restart() doesn’t restart the DMA immediately, the DMA will still be restarted in the next VSYNC event.
Drivers for some LCD and touch controllers are available in IDF Component Registry. The list of available and planned drivers with links is in this table.
Commands sent by this function are short, so they are sent using polling transactions. The function does not return before the command transfer is completed. If any queued transactions sent by esp_lcd_panel_io_tx_color() are still pending when this function is called, this function will wait until they are finished and the queue is empty before sending the command(s).
Commands sent by this function are short, so they are sent using polling transactions. The function does not return before the command transfer is completed. If any queued transactions sent by esp_lcd_panel_io_tx_color() are still pending when this function is called, this function will wait until they are finished and the queue is empty before sending the command(s).
This function can be useful when the LCD controller is out of sync with the DMA because of insufficient bandwidth. To save the screen from a permanent shift, you can call this function to restart the LCD DMA.
If CONFIG_LCD_RGB_RESTART_IN_VSYNC is enabled, you don’t need to call this function manually, because the restart job will be done automatically in the VSYNC event handler.
If this flag is enabled, the host only refresh the frame buffer when esp_lcd_panel_draw_bitmap is called. This is useful when the LCD screen has a GRAM and can refresh the LCD by itself.
[in] How many pixels already were sent to the display in this frame, in other words, at what pixel the routine should start putting data into bounce_buf
Raystar’s Graphic Display Modules are in the range of COB/COG structures. The Monochrome Graphic LCD display are included 122x32、128x64、128x128、144x32、144x64、160x32、160x80、160x128、160x160、192x32、192x64、192x128、202x32、240x64、240x128、240x160、256x128、320x240 Monochrome Graphic LCD Display Module are available in STN/FSTN with LED backlight with different interfaces in 6800、SPI、8080、I2C. Character font options are English, Japanese, Europe, Cyrillic, Hebrew, Chinese Traditional, Chinese Simplified, Korean. Check Raystar Website or email us for more product information.