PIC18F2550 KS0108 GLCD Text Test
After working with HD44780 displays for such a long time, I’ve decided to try my hand at graphical LCDs. They are cheap and effective at displaying more information than character LCDs, and in a much more concise manner. Most controllerless graphical LCDs can be difficult to work with, however the KS0107/KS0108 controller combination allow for quick and easy programming. For this project, I opted to use the AZ Displays AGM1264F 128 x 64 pixel graphical LCD with the KS0108 controller. This circuit is a very simple proof-of-concept that has acted as a stepping stone for further development into more complex programs and displays. When constructed and run, the display will show the complete custom 3×5 character set that I put together for the firmware (using the font format from Cornell University and additional font information from Michael Koss).
Full Circuit
The source and firmware for the circuit can be found at the bottom of the page. Each section of the circuit is labeled in the schematic. All of the sections and their components are described and discussed below. The part numbers for the components are linked to websites for data and more information when available.
Power Supply
The power supply uses a 9 volt battery and a TC1262-5.0V high-accuracy low-dropout linear voltage regulator to provide a stable 5 volt supply for the microcontroller and the graphical LCD. A 1uF (microFarad) polarized decoupling capacitor is necessary on the output of the voltage regulator to prevent power spikes or ripples. A wall wart power supply as low as 5.3V can be substituted for the 9 Volt battery.
AZ Displays AGM1264F
The AGM1264F is 128 x 64 pixel graphical LCD with built in controllers that allow is to be easily controlled using a PIC microcontroller. It is a 128 x 64 pixel graphical LCD and has an LED backlight, onboard negative voltage generator (7660) for LCD driving, onboard Samsung KS0108 controller, and an 8-Bit MPU interface.
Microcontroller
The microcontroller used is a Microchip PIC18F2550. I modified the PIC18F2550 Tiny PIC Bootloader assembly file so I could use a 20MHz crystal/resonator at 115,200 baud (the modified bootloader can be found at the bottom of the page). The PIC18F2550 runs at 48MHz using the internal PLL. R1 is a pull-up resistor necessary for operation. C1 is a stabilizing capacitor that is used for the onboard USB voltage regulator, which is not used in this project. The component marked ‘RES’ is a 20MHz resonator.
RS232 Level Converter
The microcontroller USART pins need to be connected to a RS-232 Level Converter to connect to a PC for firmware updates using the Tiny PIC Bootloader. Otherwise, after initial programming they can be left disconnected
Source and Firmware
The PIC must initially programmed with the ‘SAC_tinybld18F2550usb _20MHz_115200_48MHz’ hex file to program the bootloader on the PIC. Then, using Tiny PIC Bootloader, the hex file can be placed on the chip using the Tiny PIC Bootloader frontend with ’12h 34h 56h 78h 90h’ in the ‘List of codes to send first:’ in the ‘Options’ menu. Please feel free to contact me if you have any problems.
- SAC_tinybld18F2550usb_20MHz_115200_48MHz.HEX
- 18F2550 GLCD Text Test.c (hex)
- GLCD – modified.c


November 16th, 2006 at 5:25 pm
Can it be turned into a X-Y plotter? That means 2 analog inputs. Probably 2 a2d and some rountines for the GLCD.
November 30th, 2006 at 11:04 am
I m unable to generate the clock of pic18f2550 using a 20MHz crystal, please help me
waiting for reply
November 30th, 2006 at 3:04 pm
DL: Yes, you could easily create an X-Y plotter with two analog to digital inputs. However, there is switching time for the internal Analog-to-Digital Converter (ADC), which could be a problem if you want high speed data acquisition and display. Therefore, I would suggest either two external high-speed ADCs or a high-speed multi-channel ADC.
Bibhudatta: Check to make sure that you are using the correct load capacitors (see http://www.foxonline.com/techdata.htm for a basic primer). Alternatively, you may want to use a resonator.
January 15th, 2007 at 11:03 am
want some little boards to drive graphical ( T6963C ) or alphanumeric ( HD44780 ) LCD screen, with only 1 pin ?..
January 15th, 2007 at 1:16 pm
phil – I checked out your website (I always check) and saw your Serial_LCDG driver. Nice little package! I don’t have a T6963C, but I’ve been thinking about working on a similar “backpack” idea for the KS0108 graphical LCDs. You appear to have a great system and command set though.
July 29th, 2007 at 11:13 am
Dear Steve. Hi from Turkey. Your project is very nice. I used it. Do you planing make it with ds30f4011 or ds33F pics. May be fast. Can you add other osciloskop feature.Can I change time/div, volt/div x and y position, input voltaj range… etc.
Thank you very much.
Best Regards.
Ayhan.
September 22nd, 2008 at 5:40 pm
HI, where can I find tutorials about how it’s organized a 128 X 64 graphical dysplay ?
I have the datasheet but it suppose you have the Basics …
Thank you !!! Very good site with very good jobs!!!
February 18th, 2009 at 9:41 am
its great
April 6th, 2009 at 9:47 pm
How about a semiconductor curve tracer mod? I think the speed would be plenty and there is only a need for 2 a/d inputs. A small hand held curve tracer would be a great tool to carry around.
April 28th, 2009 at 4:02 pm
hi , i have purchased graphic display jhd240128d but could not interface it with either with 8051 or with arm please send all the required drivers or codes to interface with the microcontroler. we did every thing but failed . please help
August 5th, 2009 at 11:31 am
thanks for the catch. I’ll get in there and fix it….
August 29th, 2009 at 4:42 pm
Thank you !!! Very good site with very good jobs!!!
September 28th, 2009 at 7:08 am
Hello.
Many thank for your modified GLCD_text 3×5 library that I use with pleasure.
I tell however You that there is a small bug derived by the original version that doesn’t allow to visualize a character in the last pixels of the display.
//if(x+3 >= GLCD_WIDTH) // Performs character wrapping
if(x+3 > GLCD_WIDTH) // Performs character wrapping < This is correct for me.
Bye, Giorgio
October 1st, 2009 at 9:55 am
can u explain the ckt working …i m a beginner in this field…..if possible can u reply by mail
January 3rd, 2010 at 4:45 pm
No puedo correr los códigos fuentes, me marcan error, estoy utilizando el programa Dev C ++.
Me gustaría que me ayudarán a poderlos compilar.
gracias
April 1st, 2010 at 3:11 pm
please HELP MI COMO PUEDO CARGAR EL CODIGO HEX