Skip to main content

social

pop

Interfacing a 16X4 LCD

Interfacing 16X4 LCD

Simulation is done with Proteus ISIS
code: MikroC
Requirements:
  • 16X4 LCD
  • PIC16F877A
  • 8 MHz oscillator
  • A variable resistor (5k)
  • 22pF capacitor
  • A resistor (10k)

Circuit Diagram of 16X4 LCD and code is shown below


interfacing 16x4 LCD

 // Begin LCD configuration
sbit LCD_RS_direction at TRISB0_bit;
sbit LCD_EN_direction at TRISB1_bit;
sbit LCD_D4_direction at TRISB2_bit;
sbit LCD_D5_direction at TRISB3_bit;
sbit LCD_D6_direction at TRISB4_bit;
sbit LCD_D7_direction at TRISB5_bit;

sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;

// End of LCD configuration

void main()
{ char txt1[]="welcome to 16x4"; char txt2[]="LCD display";
  char txt3[]="by"; char txt4[]="EKETECH";

TRISB=0X00;   // Configure PORTB as output
PORTB=0X00;        // initialise PORTB
while(1)                           // loop
{
lcd_Init();                        //  initialise LCD
lcd_cmd(_lcd_clear);          //  clear LCD
lcd_cmd(_lcd_cursor_off); //OFF the cursor
delay_ms(100);           // delay for 0.1 second
lcd_out(1,1,txt1);               // display "welcome to 16x4" on row 1 of LCD
lcd_out(2,3,txt2);              // display "LCD display"; on row 2 column 3
delay_ms(200);             // delay for 0.2 second
lcd_out(3,4,txt3);        // display "by" on row 3 column 4 of LCD
delay_ms(200);          // delay for 0.2 second
lcd_out(4,1,txt4);                 // display "EKETECH"; on row 4 column 1
delay_ms(1500);                    // delay for 1.5 seconds

}
}

Click hereVideo

By EKETECH

Popular posts from this blog

PAST GCE QUESTIONS AND SOLUTIONS

 GCE PAST QUESTIONS AND SOLUTIONS TECHNICAL GCE ITVE and GCE ATVE Questions and Answers DOWNLOAD All ELECTRICAL POWER SYSTEM   DOWNLOAD All ELECTRONICS   DOWNLOAD All AIR CONDITIONING DOWNLOAD All MECHANICAL MANUFACTURING DOWNLOAD All AUTOMOBILE MECHANICS DOWNLOAD All SHEET METAL DOWNLOAD All WOOD WORKS    DOWNLOAD All BUILDING CONSTRUCTION DOWNLOAD All TOPOGRAPHY DOWNLOAD All CIVIL ENGINEERING DOWNLOAD All COMPUTER SCIENCE   DOWNLOAD All ICT DOWNLOAD All  ICT DOWNLOAD All CHEMICAL ENGINEERING DOWNLOAD All TOURISM DOWNLOAD All ACCOUNTING DOWNLOAD All  ICT DOWNLOAD All MATHEMATICS DOWNLOAD All LAW DOWNLOAD All ENGINEERING SCIENCE GENERAL EDUCATION GCE QUESTIONS AND SOLUTION DOWNLOAD All MATHEMATICS DOWNLOAD All FURTHER MATHEMATICS DOWNLOAD All ADDITIONAL MATHEMATICS DOWNLOAD All PHYSICS DOWNLOAD All BIOLOGY DOWNLOAD All HUMAN BIOLOGY DOWNLOAD All  ICT DOWNLOAD All CHEMISTRY DOWNLOAD All GEOGRAPHY DOWNLOAD All ECONOMICS DOWNLOAD All HISTORY D...

Intermediate switch connection and wiring diagram

Intermediate switch An intermediate switch is a switch which permits the control of a lighting point from three positions. In order to control this lighting point from the three positions, the intermediate switch is connected together with two other 2-way switches. Application: it can be used in lighting a room or hall having 3 entrances , it can also be used in long corridors and staircases. We shall be looking at these connections. Connection diagram of intermediate switching Below is an illustration of the connection. The brown lines indicated on the diagram are the switching contacts. The switch labelled 2 is an intermediate switch . The figure below is the configuration of an intermediate switch. The switch labelled 1 and 3 in the first diagram are two-way switches.  Click here to know more about two-way switches . ON and OFF positions of intermediate switching ON positions OFF positions Staircase wiring layout using an inte...

GCE QUESTIONS AND SOLUTIONS FOR ELECTRICAL POWER SYSTEMS

 DOWNLOAD GCE PAST QUESTIONS AND SOLUTIONS FOR EPS POWER ELECTRONICS  Download 1     Download 1b Download 2     Download 2b      Download 2C Download 3 AUTOMATIC CONTROL OF ELECTRICAL MACHINES Download 1 Download 2 Download 3      Download 3b Download 4      Download 4b    2020 DESIGN OF ELECTRICAL INSTALLATION Download 1 Download 2 Download 3      Download 3b      Download 3C      Download 3D CIRCUIT ANALYSIS Download 1 Download 2 Download 3 Download 4 ENGINEERING SCIENCE Download 1 2019 Download 2 2023 paper 1 Download 3   MOCK      Download 3B  Download 4         Download 5          Download 6 Download 7   ITV ELECTRICAL AND ELECTRONIC CIRCUIT  Download 1 ELECTRICAL DIAGRAM Download 1   CAP ELECTRICAL TECHNOLOGY AND DIAGRAM Download 1 Download 2   ITV...