Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering

Displaying Images on Graphical Lcd(JHD12864E) using Pic16f877 Microcontroller

By EG Projects

Here in this post/tutoriqal i am going to teach you how to display images on Graphical lcd using Pic Microcontroller(pic16F877). I am using JHD12864E graphical LcD in my Project. JHD12864E is 128×64 dimension lcd. 128×64 means it has 128 coulombs and 64 rows. So total dots it has is 128×64=8192. You can display an image of maximum size(Dimension = 128×64) with in this range. Some notable things before starting the tutorial.

  • You can only display images of .bmp format. Images bitmaps are obtained only by .bmp format. Graphical lcds consists of dots, we have to display our images on these dots and .bmp image is also comprised of dots. So can easily find bits of images of .bmp format and can map them on Graphical lcd.
  • You can only display black and white images(Monochrome images bitmap is hard to generate. No software is found for generating bitmap of monochrome images on internet).
  • If you want to display images of size greater than 128×64 than first change the size of the image. I used an online image dimension converter(My image size is 960×1280. I converted it to 128×64 using an online image dimension converter. You can found many tools to convert images just Google for it).  

​If you are new to graphical lcd and didn’t know much about it just go through the tutorial below. You will become familiar with graphical lcd, its half and pages, its commands, its pin out and how to effectively use it. It will help you in understanding the code given below.

  • Graphical lcd pin out and working. 

I am going to display five images on graphical lcd. Images which i am going to display on lcd are below. I created bitmaps of all the images given below.

Images of dimension 128x64 and format .bmp Displayed on Graphical Lcd(JHD12864E)

Images of dimension 128×64 and format .bmp Displayed on Graphical Lcd(JHD12864E)

The first pic which i am going to display is mine(The Admin). Its original size is 960×1280, format is .jpg and its a monochrome pic. I converted it to black and white, format .bmp and size is reduced to 128×64 using an online software for image editing.
Jpg image converted to bmp format using The Dot Factory

Jpg image converted to bmp format using The Dot Factory

Now when you converted images its time to find bitmaps. Bitmaps are found using special software’s. I used an open source software The Dot Factory. Just give the path of the image and click generate it will generate bitmap with in a second. Download the software from here.

thedotfactory-0.1.4.7z
File Size: 30 kb
File Type: 7z

Download File


Image BitMap using The Dot Factory

Image BitMap using The Dot Factory

Dot factory not only generates bitmaps it also gives you the dimension of the newly generated bitmaps. Once bitmaps code is generated you can copy them from their and place them in your code. 
Pic16f877 microcontroller is used to display images on jhd12864E graphical lcd. Port-B is used to send data and commands to graphical lcd. It is connected to data pins D0-D7 of Graphical lcd. Lcd controlling pins en(Enable),rs(Register-select),rw(read-write) are connected to Port-D pins#7,6,5. Graphical lcd’s First-Half selection line is connected to Port-D Pin#4 and second-half selection line is connected to Port-C Pin#4. Circuit diagram of the project is given below.
jhd12864e graphical lcd interfacing with pic16f877 microcontroller

jhd12864e graphical lcd interfacing with pic16f877 microcontroller

Coming to the code portion. Code is written in C++ language using MPLAB-IDE and HIGH-TECH C compiler is used to compile and generate hex code of the project. Functions in the code with their functions are explained below….

void delay(unsigned int d)
Delay Function is used to generate some arbitrary delay to be used in the code where necessary.
void lcdcmd(char value)
This function is sending commands to lcd. It not only send commands but also manipulate the lcd controlling pins(en,rw,rs) high and low to succesfully execute the commnad.
void lcddata(char data1)
This function is sending data to lcd. It not only send data but also manipulate the lcd controlling pins(en,rw,rs) high and low to succesfully display data on lcd.
void CS1()
This function is selecting first half of JHD12864E graphical lcd.
void CS2()
This function is selecting Second half of JHD12864E graphical lcd.
void createimage(const char *image)
Create image function is creating image on JHD12864E graphical lcd.

All the statements of the code are well commented and explained. I hope you can easily understand what each statement means.

Download the project Code, Folder Contains C++ code, MpLAb Project files, HEx file and simulation of the project. Simulation is made in proteaus8.0. If you have any questions regarding the post or you feel any difficulty in the code just write your queries below.

Watch the Project video here

                                                                                                                                 Images on Graphical Lcd(Code)


Filed Under: Microcontroller Projects, PIC Microcontroller

 

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Designing Gate Driver Circuit and Switching Mechanism for Modified Sine Wave Inverter – (Part 9/17)
  • Completing Modified Sine Wave Inverter Design with Full Bridge Circuit and Step Up Transformer – (Part 10/17)
  • Designing an Offline UPS – Part (12 /17)
  • How to reduce Switching Time of a Relay – (Part 15/17)
  • Testing MOSFET – (Part 16/17)
  • Driving High Side MOSFET using Bootstrap Circuitry – (Part 17/17)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • New automotive radar sensor enables reliable in-cabin monitoring system
  • TI breaks ground on 300-mm semiconductor wafer-fabrication plants in Texas
  • New wireless AR Smart Viewer reference design
  • Infineon launches scalable and wireless charging platform with configurable controllers
  • First single-core MPU with MIPI CSI-2 camera interface and audio

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd ldr led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • A circuit that can adjust a resistance and probing a voltage node
  • DC to DC buck converter
  • A circuit that can probe 2 currents and adjust the resistor
  • Microsoft Project 2019 dependencies
  • MOSFET ORing circuit simulation (LTspice)

RSS Electro-Tech-Online.com Discussions

  • Enclosure sought
  • Need help using a common power supply for two devices
  • Fletcher's Law
  • Setting the 18F24K20 to digital.
  • Multistage BJT amplifier
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering