Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC C Driver for HD44780 LCD

  • Author T3STY
  • Create date
  • Updated
  • Blog entry read time 2 min read
Lots of PIC projects involve the use of LCD screens as user interface. But these LCDs won't work just by connecting some wires from PIC to LCD. In fact you actually need to use proper commands to tell the LCD what to do. And here I come in help for you!
I've seen lots of LCD drivers out there, most working fine with basics but lacking advanced functionality; some were even using exclusive port access which means that even if you're not using a port's pins for your LCD you won't be able to use them anyway for any other purpose because their value will be overwritten when writing on the LCD. Instead I have written a LCD driver using the PIC C programming language, which uses independent pin control and also has some advanced functionality. Moreover, I built it so it's less of a headache configuring the LCD settings properly, which is the cause of blank screen for many people.

Used space is also important in PICs which are limited to a certain amount of memory. This driver, compiled with HiTech's PIC C Compiler in Lite mode, only uses 20% of a PIC 16F84A. You can also remove the extended display functions which will reduce the driver by about 50% in space and on the same PIC this will reduce the total used memory to only 10%! But PIC 16F84 is not the only one supported. Any PIC10, PIC12 and PIC16 MCU can be used with this driver, you only have to make sure it does not exceed the available memory on the PIC. For different PICs it should be easy porting the driver as I've used the most basic coding I could.
(!) If you make a porting of this driver for other PICs feel free to contact me. I'll be glad to add your work to this article!

Using this driver is as easy as you'd wish. The "big" work is on the HD44780.h (header) file which has to be set up according to your needs. The most important part is setting the pins that you'll be going to use for your LCD, and setting if you're going to use the 4-bit or 8-bit data transfer mode. Remember to also set the TRIS registers of the ports so the pins used for the LCD are set to output!

For more information on using the functions provided by this driver just read the HD44780.h file which I have over commented with all the information you need to know. Should you have any issues with the driver or if you find a bug please let me know using comments down of this article or by contacting me via PM or email (contacts available in HD44780.h info comments)

LICENSE
The driver is released under GPL version 3 License
Make sure you read the License.txt file included in the archive or read it online here:
https://www.gnu.org/licenses/gpl.txt

DISCLAIMER
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

DOWNLOAD
You can download the driver from the attached zip file.

If the link becomes unavailable report it and I'll make sure it comes back online.

Comments

Nice LCD driver routines.

In the future, please use the forum file/attachment manager for uploading and distribution of files, rather than a third party service like Mediafire.


BigDog
 
Sorry mate, I'm not using C18 compiler so I don't know how to help you...
 

Part and Inventory Search

Blog entry information

Author
T3STY
Read time
2 min read
Views
1,236
Comments
4
Last update

More entries in Uncategorized

More entries from T3STY

  • HD44780 C Driver v3.0
    Some of you might remember me posting an LCD Driver for HD44780 controller compatible displays (...

Share this entry

Back
Top