Recently I bought a LCD graphic display from Sure Eletronics (JCG12232A02-01, product name RDE-LM26111), this LCD use the famous SED1520 controller, a dot matrix driver inteded for display characters and graphics. After a long research I realized that this display has some peculiarities, such as not having the RESET pin and the need for a negative voltage at V0. In this document I will show how to use this LCD with a PIC16F887 from Microchip, so you will be able to use this nice and cheap LCD on your projects.
The JCG12232A02-01 is sell by Sure Eletronics, it provides 122x32 pixels with a viewing area 76.00mm x 25.20mm, has backlight and works with 5.0V. It is a nice graphic and has a good price, you can find more information about prices and shipping time at Sure Eletronics webpage, they do a good job and I never had any kind of problem.The LCD display has 18 pins, each pin is describe below:
|3||V0||Display contrast adjust. This pin needs a negative voltage relative to Vss and should be about 4.0V negative, if you vary this voltage you change the LCD contrast.|
|4||A0||Data/Command selection. When HIGH read/write buffer memory, when LOW read/write control/status register.|
|5||R/W||Read/Write control signal input pin. When R/W is HIGH you read data from display, when R/W is LOW you write data to display.|
|8||NC||This pin is not connected.|
|9-16||DB0-DB7||Data bus. These pins will receive or send the data.|
|17||A||Backlight anode (positive).|
|18||K||Backlight catode (negative).|
Note that there isn't a reset pin! This means that the SED1520 will always works with a 68 MPU family direct interface, using the same pin (R/W) as read/write select bit. The 68 MPU family and 80 MPU family refers to Motorola 6800 family and Intel 8080 family, in our case the only difference is that 68 MPU family use the same pin for R/W select bit and the 80 MPU family use two pins for R/W select bit.
This display use 2 chips to show 122x32 pixels. Each chip controls half display, E1 controls the first half (0 to 61 pixels wide and 32 pixels high) and E2 the second half (62 to 121 wide and 32 pixels high), so to read or write data into display it is necessary to select which chip will receive the action. For example, to set a pixel on coordenate 1,1 we need to select chip E1, to set a pixel on coordenate 110,1 we need to select chip E2, same to read from 1,1 or 110,1.
One important point, it is necessary a negative voltage on pin V0, without this negative voltage the display does not have contrast, making it impossible to see anything in the display.
For the JCG12232A02-01 prototype you need only a few components:
I used the PIC16F887 at 20Mhz, this is not necessary so you can use the internal oscilator at 8Mhz and discard the 20Mhz crystal. The MAX232 is used to generate the negative voltage necessary to V0 in order to obtain LCD contrast. You can use another CI or method to obtain the negative voltage, I just use the MAX232 because I have some spare parts. The eletrolytic capacitores are used with the MAX232, so if you use another method to generate the negative voltage you can put away the 1uF and 10uF capacitors from the list.
Below the schematic, please click for larger image:
The code is simple and well commented, you just need to setup the MCU ports to start using it. It was written for the Microchip PIC microcontroller using HITECH-C Lite Compiler for PIC16 (Free version) in Microchip MPLAB X IDE Beta 6.0. The main files are SED1520.c and SED1520.h. The SED1520.c contains the main functions necessary to initialise the LCD, you just have to include SED1520.h in your main file to start using the drive. The main functions are:
These basic functions allow you to use the SED1520_graphic.c library. This library contains functions to draw lines, circles, bars, rectangles, characters and strings. Just include the SED1520_graphic.h in your main file to use these functions. Please read the comments in the code to see how to use them.
Before you use the driver and the library the following parameters must be defined in SED1520.c:
I would like to say that this code was derived from the code for the SED1520 by Geoff Graham (http://geoffg.net) and from the code for the SED1520 by Radoslaw Kwiecien (http://en.radzio.dxp.pl). I do not know these guys but their base codes help-me a lot.
Below an image with the hardware and software working. In the display you can see the bitmap, square, circle, line and bar functions
Please read the CIs datasheets: