Difference between revisions of "GLCD Interface with PIC16F877A"
Line 47: | Line 47: | ||
= Downloads= | = Downloads= | ||
Download the complete project folder from the below link: | Download the complete project folder from the below link: | ||
+ | [https://github.com/ExploreEmbedded/Pic16f877a_ExploreStarterPIC library and sample codes] | ||
Latest revision as of 13:33, 16 October 2018
In this tutorial we'll see, how to interface 128*64 GLCD with PIC16F877A Starter board. We will be using KS0108 controller based JHD12864E display. There are many displays out there based on KS0108 or compatible display controller. They all work the same way, but make sure to check the datasheet for the pin diagram before doing the connection.
Contents
[hide]Prerequisites
Please check this tutorial for detailed explanation on GLCD.
Hookup
Below table shows the GLCD pins connection. Please check glcd.h file for pin configuration.
RS | RW | EN | CS1 | CS2 | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
PD_0 | PD_1 | PD_2 | PD_3 | PD_4 | PB_0 | PB_1 | PB_2 | PB_3 | PB_4 | PB_5 | PB_6 | PB_7 |
Displaying Strings
#include "glcd.h" //User defined LCD library which contains the lcd routines | |
#include "delay.h" | |
/* start the main program */ | |
void main() | |
{ | |
/* Initialize the glcd before displaying any thing on the lcd */ | |
GLCD_Init(); | |
GLCD_Printf("Interfacing\n\n"); | |
GLCD_Printf(" KS108 128x64\n\n"); | |
GLCD_Printf(" With Pic16f877a"); | |
GLCD_GoToLine(6); | |
GLCD_Printf(" ExploreEmbedded"); | |
while(1); | |
} |

Displaying Numbers
#include "glcd.h" | |
#include "delay.h" | |
void main() | |
{ | |
int count=0; | |
GLCD_Init(); | |
GLCD_DisplayString(" Displaying Numbers"); | |
while(1) | |
{ | |
GLCD_GoToLine(2); | |
GLCD_Printf("hex:%4x \n\ndec:%5d \n\nbin:%16b",count,count,count); | |
DELAY_ms(100); | |
count++; | |
} | |
} |

Displaying Bar Graphs
#include "glcd.h" | |
void main() | |
{ | |
GLCD_Init(); | |
GLCD_HorizontalGraph(0,45); | |
GLCD_HorizontalGraph(1,50); | |
GLCD_HorizontalGraph(2,82); | |
GLCD_HorizontalGraph(3,74); | |
while(1); | |
} |

#include "glcd.h" | |
void main() | |
{ | |
GLCD_Init(); | |
GLCD_VerticalGraph(0,45); | |
GLCD_VerticalGraph(1,50); | |
GLCD_VerticalGraph(2,82); | |
GLCD_VerticalGraph(3,74); | |
while(1); | |
} |

Downloads
Download the complete project folder from the below link: library and sample codes
Have a opinion, suggestion , question or feedback about the article let it out here!

Pic16f877a MPLABx Setup
In this tutorial we will see how to setup a Mplabx project to generate .hex file for Pic16f877a MPLABx Setup Steps Step1: Open the MPLABx software and select the...

Uploading Hex File Using Pickit2
In this tutorial we will see how to upload hex file using the below PICKit 2 programmer. Installing Pickit 2 Software Download and Install the Pickit2 software from...

Uploading Hex File Using Ds30 Bootloader
We will see in this tutorial how to upload hex file to PIC controller using DS30 loader GUI. Installing DS30 Software Download the DS30 Loader Software from the below...

LED Blinking with PIC16F877A Starter Board
In this tutorial we will learn how to blink the LED's with PIC16F877 Starter Board. Starter PIC board has two on board LED's connected to PORTD.0 and PORTD.1. Steps ...