How graphical lcds work?
I am going to interface jhd12864e graphical lcd with 8051 microcontroller. To learn about full pin description and internal organization of pixels of jhd12864e graphical lcd please go through the simple tutorial. This will lead you to easily understand the code written below.
The above tutorial is very important to understand the GLCD code below. If yon don’t know about the GLCD working then you can not understand the 8051 microcontroller with GLCD code below. Pin out of GLCD jhd12864e is given below.
JHD12864e GLCD with 8051 microcontroller
Steps to display text on GLCD
- Initialize the jhd12864e glcd(Display on-off,set x,y address,set start line)
- Select the graphical lcd half(left or right) Don’t understand! Take the Upper tutorial.
- Select the page Don’t understand! Take the Upper tutorial.
- Make and display text Don’t understand! Take the Upper tutorial.
How text is made and displayed on GLCD?
Now when you are done with initializing glcd and selected glcd half and page. Its time to make/display text or image on glcd. Each page of GLCD is organized in rows and coulombs (8×64 in dimension) 8 rows and 64 coulombs. Each coulomb in a page has 8 dots aligned vertically. We send an eight bit data to make these dots ON or OFF. 0 is OFF and 1 is ON. A simple command like FF=11111111 makes all dots of coulomb ON & F0=11110000 makes first four dots OFF and last four ON. You make your desired text or image by making these pixels ON or OFF. The combination of all coulombs makes a picture.
For example to display the ‘M‘ character on Glcd the data send to GLCD is below. Data is send to glcd 8-bit at a time. 8-bit data is in hexadecimal format. If we translate hexadecimal to binary it will represent the below character. Last command is not displaying any thing. Its actually the gap for another character to appear a head of ‘M‘.
JHD12864e interfacing with 8051 microcontroller – Project circuit diagram
GLCD interface with 89c51 microcontroller code
While(1) loop at the end only runs the code once. Website name “microcontroller-project.com” will be displayed on two pages of jhd12864e.
Note: Some graphical lcds select cs1, cs2(chip select) on 1 and some with 0. If you are using this code be sure that 0 selects your cs1 & cs2. If not 0 then switch cs1 & cs2 in the code just make cs1=1 where it is 0 and cs2=0 where it is 1.
Some more microcontroller projects involving jhd12864e graphical lcd are below. Images are also displayed on GLCD using variety of microcontrollers.