skip navigational linksPJRC
Shopping Cart Checkout Shipping Cost Download Website
Home MP3 Player 8051 Tools All Projects PJRC Store Site Map
You are here: 8051 Tools Development Board Example Code LCD 128x64 Pix Search PJRC

PJRC Store
8051 Dev Board, $79
LCD 128x64 Pixel, $29
LCD 20x2 Char, $11
Serial Cable, $5
9 Volt Power, $6
More Components...
8051 Tools
Main Page
Software
PAULMON Monitor
Development Board
Code Library
89C2051 Programmer
Other Resources

128x64 Graphical LCD

        lcd_init();			// init the LCD, clear the buffer
        print_to_lcd = 1;		// printf_fast to LCD buffer
        buf_set_font(font_timBI24);
        buf_set_position(6, 0);
        printf_fast("128 x 64");	// first line: 128 x 64
        buf_set_font(font_7x13B);
        buf_set_position(25, 30);
        printf_fast("Graphic LCD");	// second line: Graphic LCD
        buf_set_font(font_4x6);
        buf_set_position(0, 58);
        printf_fast("Font sizes from large to tiny...");
        for (i=4; i<120; i+=20) {
                buf_line(i, 42, i+20,  55);	// diagonal line
                buf_line(i+20, 42, i+20,  55);	// vertical line
        }
        lcd_update();			// copy buffer to LCD

Example Code

Example code (beta test version):
lcd_128x64_07.tar.gz
lcd_128x64_06.tar.gz

Fonts (beta test):
lcd_fonts_02.tar.gz
lcd_fonts_01.tar.gz

Connections To 8051 Board

How to connect to the 8051 board:

LCD             8051    Notes:
---             ----    -----
 1: Vss         Ground  (pin 1 on LCD connector)
 2: Vdd         +5V     (pin 2 on LCD connector)
 3: Vo                  Connect to 5K POT wiper
 4: D/I         A1      (pin 4 on LCD connector)
 5: R/W         A0      (pin 5 on LCD connector)
 6: E           E       (pin 6 on LCD connector)
 7: D0          D0      (pin 7 on LCD connector)
 8: D1          D1      (pin 8 on LCD connector)
 9: D2          D2      (pin 9 on LCD connector)
10: D3          D3      (pin 10 on LCD connector)
11: D4          D4      (pin 11 on LCD connector)
12: D5          D5      (pin 12 on LCD connector)
13: D6          D6      (pin 13 on LCD connector)
14: D7          D7      (pin 14 on LCD connector)
15: CS1         A2
16: CS2         A3
17: Reset               10uF cap to ground, 22K resistor to +5V
18: Vee                 Connect to POT side (other side to ground)
19: A           +5V
20: K           Ground


8051 Development System Circuit Board, Paul Stoffregen
http://www.pjrc.com/tech/8051/board5/lcd_128x64.html
Last updated: March 5, 2008
Status: work in progress, more info to come
Suggestions, comments, criticisms: <paul@pjrc.com>