graphic lcd display programming supplier
Available in character and graphic formats, COG (Chip-On-Glass) LCD Displays are designed without a PCB. The LCD driver/controller is bonded directly to the glass of the display. This allows COG displays to be smaller in size, more cost effective and a highly customizable display solution compared to typical LCD modules with a board.
Can you control the backlighting by using PWM on the backlight voltage pin? It"s connected to Vss by default which applies the entire 5v to the pin, but if I can PWM the pin and apply a lower voltage will that dim the display? In essence I"m looking for a way to dim the display using an MCU. Also, when dimmed does it draw less current? (I"m thinking it does, less photons means less work which means less current).
Also, I"m assuming that a lot of current is most likely drawn from that backlight pin so I plan on placing a transistor between the MCU and the LCD which I will drive from the MCU via PWM.
Thanks for sharing your library. I ported it to the XMEGA style and it worked except that I need to add a reset in lcd_init(). I initialized the control port with RESET low, and then I promptly set it high.
The current version of this graphic display (GDM12864H) has a unique feature that I have not seen in any other 128x64 graphic LCD. Its pixels (and pitch) are square (0.39x0.39mm) so your circles appear as circles -- no more ellipses!!!
Thanks for posting. Please explain why you have 2K ohm connected to the V0 and VEE pins? This LCD has built-in DC converter to drive the LCD already?
Someone noted above that the voltage needs to be fairly low (~-4V) to see the darkness of the pixels. If you hook a pot up, be sure to wipe it to both extremes to see if you can atleast see a big black box when the LCD has power, then you know atleast your contrast works and you"re getting power!
astromme - I am currently working on a project with this serial graphic display and I am interested in using the MSP430 could I get a copy of the adapted Arduino ks0108 library? Thank you, this would be greatly appreciated.
You should look on the product page"s documents. There"s links to get it working with an Arduino microcontroller. Also, there is an article on Arduino if you did an online search with example code and a hookup guide => http://playground.arduino.cc/Code/GLCDks0108.
I recently bought this LCD to use with a Maple Mini board. What Library should I use with it? I found the KS0108 Graphics LCD library on the Arduino page. That seems to be more useful than the LiquidCrystal library which doesn"t seem to work with this 20-pin LCD.
The one i ordered off sparkfun nearly a month ago was of the " small fraction of the glcds out there will need a reset pulse" variety? it took me a few days and several hours to realize, i had to waste another pin. The solution was to go into the library and un-comment part of the code as described at the bottom http://www.arduino.cc/playground/Code/GLCDks0108/
I"m looking for a similar specs LCD, but with a white or blue backlight.. I"m planning on adding it next to my motorcycle OEM screen, and being green would quite likely be an ugly mismatch.
Make sure that you have a 100 to 330 ohm resister in series with the LCD backlight. Some of the documentation is not clear on this, but the resister must be there or the LED backlight will act like a dead short as soon as the voltage rises above the LED forward bias - usually about 2.0V.
So, stupid question, the LCD screen says it needs 9V to work. Is that supplied by the circuits on the board, or do you need to create a step-up dc converter to change 5V into 9V?
While the microcontroller was running, i had to take the display off my test board, because (stupid as i was) i mounted the V0 pot-meter under it. When i connected it back it was working!
On the page Csloser links to, he recommends a pull down resistor. Could anyone comment on the importance of this? Could this be the cause of my one line LCD?
I grabbed the software and loaded it. The backlight works and at first I saw a few lines on the display itself (these faded). When I ran the software from that web page, nothing came out on the display. I played with the contrast potentiometer a little, but I still see nothing. The program is running (I added some Serial output for debugging).
I forgot to mention that the LCD voltage, in my experience, should be around -4V for the display to be readable. Close to -5V will turn all of the pixels fully on and above -3V they will be totally transparent. Other units may behave differently but this is how mine works.
I intended to drive this LCD with an ATmega168, which now appears to be an astonishingly bad idea if the uC has only 1K RAM and you need that to drive the LCD. True? Or am I missing something completely obvious to the non-novice? It looks like I need a separate uC (like the DiosPro) to drive the LCD, with the 168 uC controlling the DiosPro via the UART? Happy to take advice....
You don"t have to devote any ATmega168 RAM to the LCD. This component has its own video RAM, one bit per pixel, 512 bytes total. I think you have to write whole bytes at a time (8 pixels), and it doesn"t know how to draw a letter "A" by itself, but the App Note from Kronos Robotics says they have a higher-level Dios library to deal with such operations.
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.
Winstar Display is a professional Character and Graphic LCD manufacturer. Winstar"s graphic LCD displays (liquid crystal display) are available in dot matrix format of graphic resolution including 122x32, 128x64, 128x128, 144x32, 160x128, 160x160, 160x32, 160x80, 192x64, 192x128, 240x64, 320x240 and etc. The sizes are including 3" LCD, 3.2" LCD, 4" LCD Display, and etc. Winstar Graphic LCD modules are including different options of polarizer in reflective, transmissive or transflective types. Our LED backlights are available in various colors including yellow/green, white, blue, red, amber and RGB.
We have an extensive range of LCD graphic displays with various backlight and LCD type combinations. Winstar"s graphic LCD can be used on instrument and industry machinery equipment as well as electrical home appliances, consumer electronics including white goods, POS system, home applications, industrial instrument, automation, audio/visual display systems, and medical 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.
A 4.0″ monochrome, 240×128 dot matrix, COG (Chip on Glass) Graphic LCD Module in STN Negative Blue LCD Mode with Wide Temperature Range (Operating Temp: -20°C to 70°C, Storage Temp: -30°C to 80°C), and White LED Backlight. It has a six O’clock viewing direction and a transmissive polarizer suitable for darker environment. This product is assembled chip on glass with 1/128 Duty cycle and 1/12 Bias. This LCD uses Controller IC UC1608X or equivalent. This is an ROHS compliant product manufactured with ISO standards and procedures.
In this project, I will show you how to interface a 128X64 Graphical LCD with Arduino UNO. This particular LCD Module is based ST7920 LCD Controller. So, we will first see a little bit about the Graphical LCD Module and its LCD Controller ST7920.
In the previous Arduino project, I have interfaced a Nokia 5110 LCD Module with Arduino. It is also a graphical LCD which can display some basic bitmap images and graphics. But the issue with Nokia 5110 LCD Module is its resolution.
At 84 x 48 pixels, the Nokia 5110 LCD can be used for implementing a menu-based user interface. Due to its small size, the resulting menu will be limited to 3 or 4 items per page.
If we want a bigger display with more real estate to work with, then the obvious choice is to go for the bigger and better 128×64 Graphical LCD Module.
As a demonstration, after making all the hardware connections, I will display a bitmap image on the Graphical LCD Module. If you are interested in implementing a simple 16×2 Alpha-Numeric LCD with Arduino, then check out this tutorial.
At first glance, the 128×64 Graphical LCD Module seems like a bigger brother to the famous 16×2 LCD or 20×4 LCD Modules, with their similar construction and almost similar pin layout.
But there is a significant difference between those two. 16×2 or 20×4 LCDs are essentially character displays. They can only display alpha-numeric characters and some simple custom characters that are confined to a 5×8 matrix.
By using different combinations of pixels, we can basically display characters of various sizes. But the magic doesn’t end there. You can display images and graphics (small animations) as well. In a 128×64 LCD Module, there are 64 rows and 128 columns.
There are several versions of the Graphical LCD in the market. Even though the usage, application and implementations are almost identical, the main difference lies in the internal LCD Controller used to drive the dot matrix display.
Some of the commonly used LCD Controllers are KS0108, SSD1306, ST7920, SH1106, SSD1322, etc. The pin out of the final LCD Module might vary depending on the LCD Controller used. So, please verify the LCD Controller as well as the pin out before making a purchase.
The Graphical LCD Module I purchased consists of ST7920 Controller. It is manufactured by Sitronix and supports three types of bus interfaces i.e., 8-bit mode, 4-bit mode and Serial interface.
If you have used 16×2 LCD Display earlier, then you might be familiar with both 4-bit as well as 8-bit parallel interfaces. The serial interface is something new and we will explore this option in this project.
As I already mentioned, double-check with the manufacturer about the pinout of the Graphical LCD Module. The following table describes the pinout of the 128×64 LCD Module that I have.
Now that we have seen a little bit about the Graphical LCD and its controller ST7920, let us now proceed with interfacing the 128×64 Graphical LCD with Arduino. I will implement a simple circuit to demonstrate how easy it is to interface the LCD and Arduino using very few external components.
So, connect the RS, RW and E of the LCD to Digital IO pins 10, 11 and 13 of Arduino UNO. Also, in order to select the Serial Interface Mode, the PCB pin must be connected to GND.
The remaining connections are similar to a traditional 16×2 LCD. VCC and GND are connected to 5V and ground of the power supply. VO is connected to the wiper of a 10KΩ POT while the other two terminals of the POT are connected to 5V and GND respectively.
Instead of displaying characters of different fonts (yes, there are libraries using which you can implement various fonts), I will straight away display an image in the form of bitmap. Before writing the code, you need to convert the bitmap image into byte arrays.
I have used the above “The Office” logo. Remember that the resolution of the 128×64 LCD is, well 128×64 pixels. So, the maximum image size should be 128×64. So, using Microsoft Paint, I have brought down the resolution of the above image to 128×64 pixels and also saved it as Monochrome Bitmap Image.
A simple project for interfacing the 128×64 Graphical LCD with Arduino is implemented here. Instead of displaying plain characters, I have displayed a bitmap image on the LCD to show its capability.
Graphic LCD displays do not offer color options such as a TFT (Thin Film Transistor) or OLED (Organic light emitting diodes). They display graphics in one color and require less power to operate.
A Graphic LCD display is just as its name implies. This LCD module is able to display images, letters and numbers that are generated through the customer’s software.
Dot Matrix displays are identified by two sets of numbers. An example of this is a 128 x 64. This display contains 128 dots along the X axis, or horizontal, and 64 dots along the Y axis or Vertical. Each of these dots, sometimes referred to as a pixel, can be turned ON and OFF independently of each other. The customer makes use of software to tell each dot when to turn ON and OFF. This is similar to the old ‘light bright’ toy.
Any application that needs to display more than just letters and numbers can make use of a Graphic LCD display. A crane manufacture provides a display that shows the position of the crane’s boom as it moves from ground level to full extension.
Gas pumps making use of a Graphic LCD Display are able to display more than just gallons or total dollars. They can now display advertising and weather reports and you can enter your zip code, select payment type and even obtain a receipt through the touch screen interface attached to the glass of the display.
The three types of fluid that are available for use in a Graphic LCD Display is FSTN, STN and TN. Though TN (Twisted nematic display) and STN (Super-twisted nematic display) are rarely used on Graphic LCD Display. The primary reason is that FSTN (Film compensated Super Twisted Nematic) offers a wider viewing angle and a shaper contrast. It is possible to substitute STN or even TN for FSTN to save cost, but the lower performance rarely justifies the cost savings.
The backlight is what sits behind the glass to light up the display when ambient conditions make it difficult to read. The most common type of backlight is a LED (light-emitting diode). LED’s offer a very long life time and does not produce electrical interference that is common with CCFL and EL backlights.
If the size of the display is small enough, the LCD display manufacturer may make use of a side-lit instead of a backlight. Side lit displays offer the advantage of being thinner. Side lit backlights do not work well for a large size glass since it will create hot spots (bright and dim areas) on the display.
CCFL is an excellent backlight for large size displays. It provides a more even light flow and is thinner than LED’s. The drawback is the availability of CCFL backlights. They are pretty much non-existent for monochrome Graphic LCD Displays. You may be able to locate a supplier, but the MOQ (Minimum Order Quantity) of this backlight is in the thousands. CCFL’s also produce electrical noise that may interfere with adjacent circuits.
LCD controller driver chips (C/D) or IC’s are the small chips on the back of the LCD display. The job of the LCD controller driver is to convert the customer’s software, or firmware, into images on the display screen.
It is common for LCD controller drivers to be discontinued over time. This means that your LCD Display manufacturer will recommend an ‘equivalent’ controller. As a general rule we find that equivalent controller drivers are compatible with the old C/D an estimated 95% of the time. If you find that you’re current controller driver is about to become ‘end of life’, it would be wise to order samples of your display with a new C/D that is compatible and not being phased out.
If you’ve ever tried to connect an LCD display to an Arduino, you might have noticed that it consumes a lot of pins on the Arduino. Even in 4-bit mode, the Arduino still requires a total of seven connections – which is half of the Arduino’s available digital I/O pins.
The solution is to use an I2C LCD display. It consumes only two I/O pins that are not even part of the set of digital I/O pins and can be shared with other I2C devices as well.
True to their name, these LCDs are ideal for displaying only text/characters. A 16×2 character LCD, for example, has an LED backlight and can display 32 ASCII characters in two rows of 16 characters each.
If you look closely you can see tiny rectangles for each character on the display and the pixels that make up a character. Each of these rectangles is a grid of 5×8 pixels.
At the heart of the adapter is an 8-bit I/O expander chip – PCF8574. This chip converts the I2C data from an Arduino into the parallel data required for an LCD display.
If you are using multiple devices on the same I2C bus, you may need to set a different I2C address for the LCD adapter so that it does not conflict with another I2C device.
An important point here is that several companies manufacture the same PCF8574 chip, Texas Instruments and NXP Semiconductors, to name a few. And the I2C address of your LCD depends on the chip manufacturer.
So your LCD probably has a default I2C address 0x27Hex or 0x3FHex. However it is recommended that you find out the actual I2C address of the LCD before using it.
Connecting an I2C LCD is much easier than connecting a standard LCD. You only need to connect 4 pins instead of 12. Start by connecting the VCC pin to the 5V output on the Arduino and GND to ground.
After wiring up the LCD you’ll need to adjust the contrast of the display. On the I2C module you will find a potentiometer that you can rotate with a small screwdriver.
Plug in the Arduino’s USB connector to power the LCD. You will see the backlight lit up. Now as you turn the knob on the potentiometer, you will start to see the first row of rectangles. If that happens, Congratulations! Your LCD is working fine.
To drive an I2C LCD you must first install a library called LiquidCrystal_I2C. This library is an enhanced version of the LiquidCrystal library that comes with your Arduino IDE.
The I2C address of your LCD depends on the manufacturer, as mentioned earlier. If your LCD has a Texas Instruments’ PCF8574 chip, its default I2C address is 0x27Hex. If your LCD has NXP Semiconductors’ PCF8574 chip, its default I2C address is 0x3FHex.
So your LCD probably has I2C address 0x27Hex or 0x3FHex. However it is recommended that you find out the actual I2C address of the LCD before using it. Luckily there’s an easy way to do this, thanks to the Nick Gammon.
But, before you proceed to upload the sketch, you need to make a small change to make it work for you. You must pass the I2C address of your LCD and the dimensions of the display to the constructor of the LiquidCrystal_I2C class. If you are using a 16×2 character LCD, pass the 16 and 2; If you’re using a 20×4 LCD, pass 20 and 4. You got the point!
First of all an object of LiquidCrystal_I2C class is created. This object takes three parameters LiquidCrystal_I2C(address, columns, rows). This is where you need to enter the address you found earlier, and the dimensions of the display.
In ‘setup’ we call three functions. The first function is init(). It initializes the LCD object. The second function is clear(). This clears the LCD screen and moves the cursor to the top left corner. And third, the backlight() function turns on the LCD backlight.
After that we set the cursor position to the third column of the first row by calling the function lcd.setCursor(2, 0). The cursor position specifies the location where you want the new text to be displayed on the LCD. The upper left corner is assumed to be col=0, row=0.
There are some useful functions you can use with LiquidCrystal_I2C objects. Some of them are listed below:lcd.home() function is used to position the cursor in the upper-left of the LCD without clearing the display.
lcd.scrollDisplayRight() function scrolls the contents of the display one space to the right. If you want the text to scroll continuously, you have to use this function inside a for loop.
lcd.scrollDisplayLeft() function scrolls the contents of the display one space to the left. Similar to above function, use this inside a for loop for continuous scrolling.
If you find the characters on the display dull and boring, you can create your own custom characters (glyphs) and symbols for your LCD. They are extremely useful when you want to display a character that is not part of the standard ASCII character set.
CGROM is used to store all permanent fonts that are displayed using their ASCII codes. For example, if we send 0x41 to the LCD, the letter ‘A’ will be printed on the display.
CGRAM is another memory used to store user defined characters. This RAM is limited to 64 bytes. For a 5×8 pixel based LCD, only 8 user-defined characters can be stored in CGRAM. And for 5×10 pixel based LCD only 4 user-defined characters can be stored.
After the library is included and the LCD object is created, custom character arrays are defined. The array consists of 8 bytes, each byte representing a row of a 5×8 LED matrix. In this sketch, eight custom characters have been created.
The use of a graphical LCD (GLCD) drastically changes the look of your project. It provides more freedom for presenting data than the HD44870 based character LCDs. Today we will see how to interface a KS0108 (name of the display controller chip) based GLCD to a PIC microcontroller. This experimental tutorial is divided into two parts. In the first part, we will see how to write a firmware for the PIC microcontroller to initialize the GLCD and send data to plot points and lines on the screen. The second part will focus more on exploring the built-in GLCD Library of mikroC Pro for PIC compiler to display more complex texts and objects. Since GLCDs are real resource hungry devices (in terms of required I/O pins and memory), a bigger size PIC microcontroller (PIC16F887, which has 36 I/O pins and 14KB flash memory) is selected for this experiment. I am using MikroElektronika’s UNI-DS6 development board to demonstrate this project, but the circuit setup can also be made on a breadboard.
The graphical LCD used in this experiment is Winstar’s WDG0151-TMI module, which is a 128×64 pixel monochromatic display. It uses two Neotic display controller chips: NT7108C and NT7107C, which are compatible with Samsung KS0108B and KS0107B controllers. The KS0108B (or NT7108C) is a dot matrix LCD segment driver with 64 channel output, and therefore, the WDG0151 module contains two sets of it to drive 128 segments. On the other hand, the KS0107B (or NT7107C) is a 64-channel common driver which generates the timing signal to control the two KS0108B segment drivers. The KS0108B and KS0107B are a very popular controllers and have made their way into many graphical LCDs. The internal block diagram of the WDG0151 GLCD module is shown below.
The NT1707C drives the 64 display lines, COM1 – COM64. The first NT7108C drives the left half segments (SEG1 to SEG64) and the second one drives the right half segments (SEG65 to SEG128) of the display. The two halves of the display can be individually accessed through the chip select pins (CS1 and CS2) of the two NT7108C drivers. Each half consists of 8 horizontal pages (0-7) which are 8 bits (1 byte) high. This is illustrated in the drawing below.
Starting from page 0 on the left half (/CS1 = 0) if you transmit one data byte, it will appear on the first column of page 0. If you repeat this 64 times, then switch to the second half, and repeat until 128th position is reached, the first 8 display lines will be plotted. The next 8 lines can be plotted similarly by switching to page address 1. The total amount of bytes needed for a complete display frame (128×64 pixels) is, therefore, 2 * 64 pixels * 8 bits = 1024 bytes.
The Winstar WDG0151-TMI module does have an internal negative voltage generator circuit which provides a negative voltage at VEE external pin. An external potentiometer (usually 10 K) is connected between Vcc and VEE pins to set the LCD working voltage (contrast) at Vo pin. The pin diagrams of KS0108 based GLCDs is not standardized and it is therefore, important to read the manufacturer’s datasheet for correct wiring of a GLCD module. The following table shows the pin descriptions of Winstar WDG0151-TMI module. It has altogether 20 pins. The first two pins (1 and 2) are the chip select pins for the left and right display controller. They are active low in a WDG0151-TMI module, but they could be active high in some other models. That’s why I said reading manufacturer’s datasheet is very important. The WDG0151-TMI module operates at 5.0 V power supply. Pin number 6 is Data/Instruction (also called Register Select, RS) select pin. The 8-bit data fed to D0-D7 pins of the GLCD is received by the LCD controller chip as an instruction if D/I = 0, and as data if D/I is 1. The R/W and E pins have similar functions as in a HD44780 based character LCD module. A fixed resistor value must be connected in series with the back-light LED (pins 19 and 20) to limit the current.
The KS0107/KS0108 does not have a character generator so this must be implemented in the microcontroller firmware. The LCD controller supports a handful of instructions which are summarized in the table shown below. Note that the RS (D/I) pin is high only during data read and data write operations, and stays low when a transmitted byte is an instruction.
The circuit diagram for this experiment is shown below. The PIC16F887 microcontroller is used to drive a Winstar WDG0151-TMI GLCD. The data pins are connected to PORTD and other control signals are driven through PORTB pins. I am trying this circuit on MikroElektronika’s UNI-DS6 development board.
We will be writing our test program in C using MikroElektronika’s mikroC Pro for PIC compiler. Although, the compiler does provide built-in library routines for GLCD operations, we will first try to write our own test code for transferring display data from the PIC16F887 to the GLCD. Later, we will explore the MikroElektronika’s GLCD library for more complex operations. The code provided below generates 11 dotted horizontal lines on the GLCD screen with a six-line spacing between two. I took most portion of it from Osama’s Lab GLCD library and modified it to suit with mikroC Pro for PIC and WDG0151-TMI GLCD. Here’s a brief description of various user-defined function subroutines used in the code.
GLCD_ON() : This function turns the display on. This can be done by sending the command 3Fh to both the controllers. So, while sending this command, both CS1 and CS2 must be pulled low. Similarly the RS pin should be low too as the byte sent is an instruction.
Set_Start_Line() : This function changes the line number to be displayed at the top of the screen. You can set it to be any number between 0 to 63. It does not affect the data in the display RAM, it just scrolls the display up and down.
GLCD_Read() : Returns a byte read from the current display location. If you see the code for this subroutine, you will see there are two read operations involved. The first one is a dummy read during which the data is fetched from the display RAM is latched in to the output register of KS0108B. In the second read, the microcontroller can get the actual data.
In this experimental tutorial, the internal block diagram of a KS0108 based 128×64 pixel GLCD, its pin configurations, and instruction set were discussed briefly. The GLCD operation was demonstrated with a Winstar WDG0151 GLCD module interfaced to the PIC16F887 microcontroller. A very basic firmware was written in mikroC Pro for PIC to demonstrate how to activate selected pixels on the screen to draw a line. In the second part of this tutorial (will be posted soon) we will learn to use the built-in GLCD library of mikroC Pro for PIC compiler to draw more complex objects and texts on the screen.