LCD Interfacing with 8051 Microcontroller
LCD Interfacing with 8051 Microcontroller Hex Code Command to LCD Instruction Register 0F LCD ON, cursor ON 01 Clear display screen 02 Return home 04 Decrement cursor (shift cursor to left) 06 Increment cursor (shift cursor to right) 05 Shift display right 07 Shift display left 0E Display ON, cursor blinking 80 Force cursor to the beginning of the first line C0 Force cursor to the beginning of the second line 38 2 lines and 5×7 matrix 83 Cursor line 1 position 3 3C Activate the second line 08 Display OFF, cursor OFF C1 Jump to the second line, position 1 OC Display ON, cursor OFF C1 Jump to the second line, position 1 C2 Jump to a second line, position 2 Circuit Diagram : Source Code: // Program for LCD Interfacing with 8051 Microcontroller (P89V51RD2) #include<reg51.h> #include <string.h> #define display_port P2 //Data pins connected to port 2 on microcontroller sbit rs = P0^0; //Register Select pin connected to pin 0 of port 0 sbit rw = P0^1; // Read/Write pin c