0% found this document useful (0 votes)
29 views5 pages

header File

This document contains code for initializing and displaying text on an LCD screen. It defines functions for initializing the LCD, sending commands to the LCD, sending character data to the LCD, and inserting delays. The main function continuously initializes the LCD and displays the string "BLUE CHIP" on the LCD.

Uploaded by

Harish Sekaran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views5 pages

header File

This document contains code for initializing and displaying text on an LCD screen. It defines functions for initializing the LCD, sending commands to the LCD, sending character data to the LCD, and inserting delays. The main function continuously initializes the LCD and displays the string "BLUE CHIP" on the LCD.

Uploaded by

Harish Sekaran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

#include <REGX51.

H> //HEADER FILE void lcdinit(); void lcdcmd(unsigned char value); //FUNCTION
DECLARATION

void lcddat(unsigned char *value); void delay(unsigned int itime); unsigned char *k=BLUE CHIP";
unsigned int i,j; sbit rs=P3^5; sbit rw=P3^6; sbit en=P3^7; //BIT ADDRESSING

//GLOBAL DECLARATION

void main() { while(1) { lcdinit(); //INITIALISING LCD lcdcmd(0x80); //LCD COMMANDS lcddat(k); } }

void lcdinit() { lcdcmd(0x38); delay(20); lcdcmd(0x0e); delay(20); lcdcmd(0x01); delay(20); lcdcmd(0x06); delay(20); }

//LCD COMMANDS

void delay(unsigned int itime) { for(i=0;i<itime;i++) for(j=0;j<1275;j++); } void lcdcmd(unsigned char value) { rs=0; //COMMAND PASSING rw=0; //WRITE OPERATION P0=value; en=1; //ENABLE HIGH delay(1); en=0; }

void lcddat(unsigned char *value) { for(;*value;) { P0=*value++; //SENDING DATA rs=1; //DATA PASS rw=0; //WRITE OPERATION en=1; //ENABLE HIGH delay(1); en=0; } }

You might also like