A character LCD traditional built with a controller inside especially the HD44780. It's easy to control with some basic LCD instruction. For more technical details and programming interface for this type of LCD controller click here to view. Character LCD are available from as single to multiple lines and multiple characters.
00:00 / 00:00
![]() |
A running Program |
In CCS PIC an LCD software driver is ready to use in side the compiler. The LCD.C driver could control a character LCD only for two line character LCD. Within this driver there are a lot of functions lists below.
- lcd_init() - must be called before calling other function
- lcd_putc() - send one character to LCD
- lcd_gotoxy(x,y) - set write position on LCD, start from 1,1
- lcd_getc(x,y) - return character at the position x,y on LCD
- lcd_cursor_on(int1 on) - turn on cursor
- lcd_set_cgram_char(w,*p) - write custom character to CGRAM
In this example, the LCD prints the duration of MCU started up time. The C printf function could be use to send the character to LCD by adding the LCD_PUTC stream to this function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<18f4550.h> | |
/*Use high speed clock no PLL prescaler | |
no system clock post scaler */ | |
#fuses HS,PLL1,CPUDIV1 | |
#use delay(clock=20M) | |
#define LCD_ENABLE_PIN PIN_B2 | |
#define LCD_RS_PIN PIN_B0 | |
#define LCD_RW_PIN PIN_B1 | |
#define LCD_DATA4 PIN_B4 | |
#define LCD_DATA5 PIN_B5 | |
#define LCD_DATA6 PIN_B6 | |
#define LCD_DATA7 PIN_B7 | |
#include<lcd.c> | |
void main(){ | |
char secondCount=0; | |
lcd_init(); | |
//First Line | |
lcd_gotoxy(1,1); | |
//Send characters to LCD | |
printf(LCD_PUTC,"Power Up Time:"); | |
while(1){ | |
//Second Line | |
lcd_gotoxy(1,2); | |
//Send character to LCD | |
printf(LCD_PUTC,"%u seconds ",secondCount); | |
delay_ms(1000); | |
secondCount++; | |
} | |
} |
Click here to download this example in zip file.
![]() |
Schematic Diagram |
Fantastic read! Your thorough research and engaging style make complex topics accessible and intriguing. I appreciate your fresh perspectives and clear explanations. Looking forward to more insightful content. Keep inspiring and educating us with your wonderful work!
ReplyDeletePLL Clock Drivers
Enrgtech