Tuesday, 14 March 2017

LCD Display Using PIC




LCD Display Using PIC  

Intan Zahirah Binti Hazizol
Muhammad Daniel Bin Rosli

Synopsis

This is the layout template for emsa and emsb mini project. Each group can post a blog based on this template. This project is to use LCD using PIC16F877A. Using 16×2 Character LCD is a very basic LCD module which is commonly used in electronics projects and products. It contains 2 rows that can display 16 characters. Each character is displayed using 5×8 or 5×10 dot matrix. It can be easily interfaced with a microcontroller. 

1) List of hardware, software and components

Hardware
i. SK40C
ii. Programmer UIC00B
iii. LCD 16 x 2

Software
i. MPLab ver 8.3
ii. Hi-Tech C compiler ver 2.3


2) The Circuit diagram for this project



3) The coding

#include<htc.h>
#include<pic.h>

#define RS RB6
#define EN RB7
#define D0 RC0
#define D1 RC1
#define D2 RC2
#define D3 RC3
#define D4 RC4
#define D5 RC5
#define D6 RC6
#define D7 RC7

#define _XTAL_FREQ 8000000

#include "lcd.h"

void main()
{
  int i;
  TRISB = 0x00;
  TRISC = 0x00;
  Lcd8_Init();
  while(1)
  {
    Lcd8_Set_Cursor(1,1);
    Lcd8_Write_String("electroSome LCD Hello World");
    for(i=0;i<15;i++)
    {
      __delay_ms(1000);
      Lcd8_Shift_Left();
    }
    for(i=0;i<15;i++)
    {
      __delay_ms(1000);
      Lcd8_Shift_Right();
    }
    Lcd8_Clear();
    Lcd8_Set_Cursor(2,1);
    Lcd8_Write_Char('e');
    Lcd8_Write_Char('S');
    __delay_ms(2000);
  }
}

We need to add header file lcd.h

Adding a Header File

The code for lcd.h is shown below,
...

4) The video below showing the circuit connection and the result of the project.



5) Conclusion







No comments:

Post a Comment