Skip to content

MrChunckuee/LCDisplay_Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LCDisplay Library

A C library for driving standard character LCDs (HD44780 compliant) with Microchip PIC microcontrollers. Designed for ease of use, it supports both 4-bit and 8-bit modes and is compatible with any PIC16 or PIC18 device using the XC8 compiler. Also have option for show big digits segments.

Features

  • Flexible Configuration: Uses a structure-based initialization for easy integration.
  • LCD Sizes: Supports 16x1, 16x2, 20x2, and 20x4 modules.
  • 4-bit Mode Support: Save I/O pins by using only 4 data lines.
  • Smart Functions: Includes commands for clear screen, home, cursor positioning, and custom character creation.
  • Special feature: Includes files for displaying characters in large segments (LCD_BIGDigits.c and LCD_BIGDigits.h).

Hardware Connection

Typical connection for 4-bit mode operation:

LCD Pin Function PIC Connection (Example)
VSS Ground GND
VDD Power +5V
VO Contrast Potentiometer Center
RS Register Select Digital Pin (e.g., RD2)
RW Read/Write GND (Always Write)
E Enable Digital Pin (e.g., RD3)
D4-D7 Data Bits Digital Pins (e.g., RD4-RD7)
A / K Backlight +5V / GND (via resistor)

Usage Example

This example shows how to initialize the display and print formatted text.

#include <xc.h>
#include "lcd_display.h"

void main(void) {
    // Initialize system ports
    SYSTEM_Initialize();
    
    // Initialize LCD (4-bit mode default)
    LCD_Init();
    
    // Clear screen and say hello
    LCD_Clear();
    LCD_SetCursor(1, 1); // Row 1, Column 1
    LCD_Print("MrChunckuee");
    
    LCD_SetCursor(2, 1); // Row 2, Column 1
    LCD_Print("PIC18F25K22");
    
    while(1) {
        // Your application logic
    }
}

Project Structure

  • src/: Core library files (LiquidCrystalDisplay.c, LiquidCrystalDisplay.h, LCD_BIGDigits.c and LCD_BIGDigits.h).
  • examples/: Project examples for MPLAB X.
  • LICENSE: MIT License.
  • CHANGELOG: History of updates and bug fixes.

Documentation & Tutorial

For a detailed implementation explanation and step-by-step guide, you can review the following examples:

About

Library for control LCD16x2 or LCD20x4 display and option for show big digits segments

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors