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
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.
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
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.