You are on page 1of 5

Port City International University

Mid-Term Lab Report

Report Name: Write a code to show “Hello” on LCD.


Report No : 03
Course Code : EEE-332

Course Title : Microprocessor and Interfacing Laboratory

Submitted To : Submitted By :

Name : Mr. Swarup Chakraborty Name : Mohammad Munirul Islam

Senior Lecturer, Batch : 14 th A-Day

Department Of EEE ID: EEE 01406292


Port City International University Port City International University
Date Of Submission: 3/10/2021
Name of the experiment: Write a code to show “Hello” on LCD.
Software:
 Proteus
 Micro-c

Write a code to show HELLO on LCD display:


sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D4 at RB0_bit;
// Pin direction
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D7_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB0_bit;
char text [6];

void main ()
{
Lcd_Init(); //Initializes LCD module.
Lcd_Out(1,1,"Hello"); // display the text in row =1 and columns = 1
}

Result & circuit diagram on Proteus:


Homework:

Write a code to show my name and ID on LCD:


sbit LCD_RS at RB4_bit;

sbit LCD_EN at RB5_bit;

sbit LCD_D7 at RB3_bit;

sbit LCD_D6 at RB2_bit;

sbit LCD_D5 at RB1_bit;

sbit LCD_D4 at RB0_bit;

// Pin direction

sbit LCD_RS_Direction at TRISB4_bit;

sbit LCD_EN_Direction at TRISB5_bit;

sbit LCD_D7_Direction at TRISB3_bit;

sbit LCD_D6_Direction at TRISB2_bit;

sbit LCD_D5_Direction at TRISB1_bit;

sbit LCD_D4_Direction at TRISB0_bit;

char text[6];

void main ()

Lcd_Init(); //Initializes LCD module.


Lcd_Out(1,1,"Munir-EEE01406292"); // display the text in row =1 and columns = 1

Result & circuit diagram on Proteus:

2) Code For turn on/ off LED alternately and show the status of the
LED in the LCD:
sbit LCD_RS at RB4_bit;

sbit LCD_EN at RB5_bit;

sbit LCD_D7 at RB3_bit;

sbit LCD_D6 at RB2_bit;

sbit LCD_D5 at RB1_bit;

sbit LCD_D4 at RB0_bit;

// Pin direction
sbit LCD_RS_Direction at TRISB4_bit;

sbit LCD_EN_Direction at TRISB5_bit;

sbit LCD_D7_Direction at TRISB3_bit;

sbit LCD_D6_Direction at TRISB2_bit;

sbit LCD_D5_Direction at TRISB1_bit;

sbit LCD_D4_Direction at TRISB0_bit;

void main ()

Lcd_Init(); //Initializes Lcd module.

while(1)

PORTB = 0b00001000;

LCD_out(1,1,"LED1 ON");

LCD_out(1,1,"LED2 OFF");

delay-ms(1000);

PORTB = 0b00010000;

LCD_out(1,1,"LED1 Off");

LCD_out(2,1,"LED2 On");

delay-ms(1000);

You might also like