lcd interfacing with 8051 c programming

Thread Starter

khan yousufzai

Joined Aug 31, 2012
19
please anybody send me lcd all commands c programming 8051 microcontroller i use,,,,please also tell me that commands for 16x2 lcd and 16x4 lcd are the same or different
 
please anybody send me lcd all commands c programming 8051 microcontroller i use,,,,please also tell me that commands for 16x2 lcd and 16x4 lcd are the same or different
hi khan yousufzai,
The commands are same for 16x2 &16x4 but the address are different. the commands are get from google itself.
 
1. 0X38 - Initialization of LCD
2. 0X0E - Cursor on of LCD means it will show the cursor
3. 0X01 - It will clear the LCD screen (if already some data has been written)
4. 0X06 - It will start writing the data from left to right
or
0X04 - It will start writing the data from right to left
Send any one of the two(06 or 04) command to LCD
5. 0X80 - It will Start the cursor from first row and first column. Change it according to your requirement from 80 to 8F.
0XC0 - It will start the cursor from second row first column. Change it from C0 to CF (for 16*2)

For 16*4 only the 5th command will differ.
 

t06afre

Joined May 11, 2009
5,934
Also the correct timing is VERY important. If you write a command to the LCD before it is done with the previous. The LCD will not work properly. The datasheet will inform you about the details regarding this matter
 
Top