LCD
LCD
LCD
The matrix is controlled by Hitachi HD44780 controller, which performs all the
operations that are required to run the matrix.
• E - "Enabling" pin; when this pin is set to logical low, the LCD
does not care what is happening with R/W, RS, and the data bus
lines; when this pin is set to logical high, the - LCD is processing
the incoming data
4.RS(Register select)
5.RW(read-write)
6.EN(Enable)
RS(Register select)
Register select selects the HD44780 controller register
ENABLE(ENABLE SIGNAL):
When register RS(command and data) is selected and set
RW(Read-write) and placed the raw value on 8-bit data lines
then the instruction is to be executed.
• Send 01H for clearing the display and return the cursor.
Sending data to the LCD
• The steps for sending data to the LCD module is given below. I
have already said that the LCD module has pins namely RS, R/W
and E.
• It is the logic state of these pins that make the module to determine
whether a given data input is a command or data to be displayed.
• Make RS=0 if data byte is a command and make RS=1 if the data
byte is a data to be displayed.
void LCD_ENABLE() // Signal for LCD enable (high to low with 50ms)
{
IO0SET = LCD_CMD_PORT(0x08); // enable is set to 1
DELAY_1S(50); // 50ms delay
IO0CLR = LCD_CMD_PORT(0x08); // enable is cleared to 0
}
// LCD initialize
while(1)
{
LCD_CMD(0x18); //to shift message to LEFT use code: 0x18,Right:0x1C,Stable:0x06
DELAY_1S(50);
}
}