Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey 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
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Display custom urdu language characters on 16×2 lcd using pic16f877a microcontroller

By EG Projects March 22, 2024

In this project i am going to display urdu language characters on 16×2 lcd using pic16f877 microcontroller. Urdu is a language spoken in Pakistan, India and Bangladesh. Character lcd’s generally contains a Hitachi HD4478 controller in it. Hd4478 only contains ASCII character set in it and we can only display the predefined characters that are present in it. It contains numeric, English and Chinese language characters in it.
So to display urdu characters we must know about how to make custom characters and display it on character 16×2 lcd. Displaying self made custom characters on lcd requires knowledge about internal structure of lcd. To display custom characters like urdu you should know about lcd CG-RAM,data & command registers.

A good and perfect tutorial to understand the internal structure of lcd CG(character generated) ram is given below. Since its very important and lengthy topic so it is not possible to explain it here. I recommend you to please take the below tutorial other wise you will be unable to understand the project code below. 

  • How to generate custom characters in cg ram of 16×2 character lcd. ​

Project Requirements

  • Pic 16f877 microcontroller
  • 16×2 lcd
  • Crystal 20 MHz
  • Potentiometer (For setting lcd Contrast)
Lcd is interfaced with Pic16f877 microcontroller in 8-bit mode. Lcd data pins are directly connected to Port-B of Pic16f877 microcontroller. Lcd control signals rw(read-write) rs(register select) and en(enable) are provided by Port-D pins RD5,RD6 and RD7 of Pic16f877 microcontroler. The circuit diagram of the project is given below.

Custom Urdu characters displayed on lcd using pic microcontroller

Custom Urdu characters displayed on lcd using pic microcontroller

Coming to the code portion. The code is written in c language using MP-lab ide. High tech c compiler is used to compile the code. Header file htc.h is imported first. This file is must to be included in every project that is using high tech c compiler for compiling the code. Then crystal frequency is defined which is 20 MHz(20e6=20^6). Lcd control pins are defined next. Then the delay() function is defined which is generating some arbitrary delay for us. lcdcmd() function is sending commands to command register of lcd. dispaly() function is sending data to data register of lcd. If you dont know about lcd data and command register and their working here is a good tutorial.

  • Lcd data and command registers working

Lcdint() function is initializing our lcd. The tutorial given a line above also covers the lcd intialization phase and intializing commands. In the main fuction i am generating urdu alphabets in CG-RAM and then they are diaplayed on 16×2 lcd. First i give command lcdcmd(0x40) to lcd. This 0x40 is the starting address of CG-RAM. Then the individual dots of urdu first character “i” is send to lcd. Next 0x48 is send to lcd. Which is the second address of CG-RAM character. Second character dots are then send to CG-RAM of lcd. This process repeats for the eight characters. Then all the eight custom generated characters are invoked for displaying on lcd by just giving their address(0 to 8).
After displaying first eight urdu characters next eight are build in CG-RAM and then displayed on lcd. This process repeats until the last character is displayed. After last character the lcd starts from beginning and starts displaying urdu characters from beginning. 

Note: Lcd first line continuously display “Urdu Characters!” and the urdu characters are displayed on the second line. Each urdu character is displayed on lcd with one matrix gap from other. Since 16×2 lcd has 16 coulombs so 8 characters with one matrix sepration from others are perfectly displayed on the lcd second line.

Project Code/Files

Filed Under: Electronic Projects, PIC Microcontroller

 

Next Article

← Previous Article
Next Article →

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.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

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!


RSS EDABOARD.com Discussions

  • Reducing "shoot-through" in offline Full Bridge SMPS?
  • High Side current sensing
  • How to simulate power electronics converter in PSpice?
  • Voltage mode pushpull is a nonsense SMPS?
  • Layout IRN reduction in Comparator

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 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

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey 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
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe