PIC18F2550 KS0108 GLCD Text Test

PIC18F2550 KS0108 GLCD Text TestAfter 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

PIC18F2550 KS0108 GLCD Text Test

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

PIC18F2550 KS0108 GLCD Text Test 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

PIC18F2550 KS0108 GLCD Text Test 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

PIC18F2550 KS0108 GLCD Text Test 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

PIC18F2550 KS0108 GLCD Text Test 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

Responses to “PIC18F2550 KS0108 GLCD Text Test”

  1. DL Says:

    Can it be turned into a X-Y plotter? That means 2 analog inputs. Probably 2 a2d and some rountines for the GLCD.

    ReplyReply
  2. Bibhudatta Pradhan Says:

    I m unable to generate the clock of pic18f2550 using a 20MHz crystal, please help me

    waiting for reply

    ReplyReply
  3. Steve Says:

    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.

    ReplyReply
  4. phil Says:

    want some little boards to drive graphical ( T6963C ) or alphanumeric ( HD44780 ) LCD screen, with only 1 pin ?..

    ReplyReply
  5. Steve Says:

    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.

    ReplyReply
  6. Ayhan DAYANIK Says:

    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.

    ReplyReply
  7. Beny HARDER Says:

    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!!!

    ReplyReply
  8. adie Says:

    its great

    ReplyReply
  9. Jack Davis Says:

    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.

    ReplyReply
  10. muzakkir sharieff Says:

    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

    ReplyReply
  11. Zashkaser Says:

    thanks for the catch. I’ll get in there and fix it….

    ReplyReply
  12. Ukrainki Says:

    Thank you !!! Very good site with very good jobs!!!

    ReplyReply
  13. Giorgio Says:

    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

    ReplyReply
  14. richa Says:

    can u explain the ckt working …i m a beginner in this field…..if possible can u reply by mail

    ReplyReply
  15. gerardo Says:

    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

    ReplyReply
  16. cesar segura Says:

    please HELP MI COMO PUEDO CARGAR EL CODIGO HEX

    ReplyReply

Leave a Reply

Trackbacks/Pingbacks to “PIC18F2550 KS0108 GLCD Text Test”