0% found this document useful (0 votes)
38 views

Here Is A Code in C For Interfacing LCD in 8-Bit Mode

This code provides an example of interfacing an LCD display in 8-bit mode using C. It initializes the LCD, displays the text "DANATECHNOLOGY" by sending character codes, and includes functions for sending command and display data to the LCD. The LCD is initialized by sending specific command codes and delaying to allow processing between each command.

Uploaded by

dannycbs
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Here Is A Code in C For Interfacing LCD in 8-Bit Mode

This code provides an example of interfacing an LCD display in 8-bit mode using C. It initializes the LCD, displays the text "DANATECHNOLOGY" by sending character codes, and includes functions for sending command and display data to the LCD. The LCD is initialized by sending specific command codes and delaying to allow processing between each command.

Uploaded by

dannycbs
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Here is a Code in C for interfacing LCD in 8-bit mode.

. #define rs #define rw #define enable #define lcd_port main() { Lcd_Ini(); lcd_command(0x86); lcd_display(D); lcd_display(N); lcd_display(A); lcd_command(0x0C4); lcd_display(T); lcd_display(E); lcd_display(C); lcd_display(H); lcd_display(N); lcd_display(O); lcd_display(L); lcd_display(O); lcd_display(G); lcd_display(Y); while(1) { } --. } void Lcd_Ini() { lcd_command(0x38); delay_ms(30); lcd_command(0x0c); delay_ms(10); lcd_command(0x06); delay_ms(10); lcd_command(0x01); delay_ms(10); } void lcd_command(unsigned char command) { rw=LOW; rs=LOW; lcd_port=command; enable=HIGH; enable=LOW; delay_ms(5); } void lcd_display(unsigned char display) { rw=LOW; rs=HIGH; lcd_port=display; P2_5 P2_6 P2_7 P0

enable=HIGH; enable=LOW; delay_ms(1); }

You might also like