Overview
The industrial standard HD44780 character LCD controller is popular display among electronic hobbyists and commercial product for a few decade. Currently it still popular among students who start micro-controller programming, hobbyist electronic project or even low end consumer electronic product. It doesn't obsolete due to the newer replacement controllers that are fully compatible in controller chips and device footprint. It is very easy to use, wide availability and low cost.
There many choices for this LCD, 8x1, 8x2, 16x1, 16x2, 16x4, 20x4 etc. The manufacture produce many types of this LCD that have different character and back-light colors and size.
The interface of this LCD is an 8-bit parallel port with three control pins. However the micro-processor can interfaces to this LCD using a 8-bit data transfer mode that can save pins usage. It is very common for most of micro-controller programming. For tutorial how to use this LCD controller please visit these post,
- ATMega32 Interfaces To HD44780 Character LCD Module
- ATMega32 interfaces to HD44780 Character LCD in 4-bit mode
ATMega644P LCD Interfacing
This simple task could be done using a smaller micro-controller for instance the PIC16F84A. However we can use any micro-controller that is suitable for the project. I have many 16x2 LCD and a few 16x4 LCD that left from my university time and finished projects.
TC1604A-01A 16x4 LCD Interfacing
This LCD module is obsolete now. But there are a lot of replacement LCD module with different color and very low cost. In this example the ATMega644P use its 8-bit PortA to send command and data to the LCD while PortC is selected as control pins. The R/W pin is wire to GND because the micro-controller just need to send data or command.
![]() |
| Top View |
![]() |
| Back View |
The brightness of this LCD is lower than new product since there is a limit on LED technology at that time.
- /*
- * 6-hd4470_1604_8.c
- *
- * Created: 1/27/2026 8:02:41 PM
- * Author : Admin
- */
- #include <avr/io.h>
- #include <util/delay.h>
- #define F_CPU 16000000UL
- #define RS 0
- #define EN 2
- void lcd_command(uint8_t command){
- PORTA&=~(1<<RS);
- PORTA|=(1<<EN);
- PORTC=command;
- PORTA&=~(1<<EN);
- _delay_us(100);
- }
- void lcd_data(uint8_t data){
- PORTA|=(1<<RS);
- PORTA|=(1<<EN);
- PORTC=data;
- PORTA&=~(1<<EN);
- _delay_us(100);
- }
- void lcd_text(char *txt){
- while(*txt) lcd_data(*txt++);
- }
- void lcd_xy(char x, char y){
- // 20x4 LCD
- //uint8_t tbe[]={0x80,0xC0,0x94,0xD4};
- // 16x4 LCD
- char tbe[]={0x80,0xC0,0x90,0xD0};
- lcd_command(tbe[y-1]+x-1);
- _delay_ms(100);
- }
- void lcd_clear(void){
- lcd_command(0x01);
- _delay_ms(1000);
- }
- void lcd_init(void){
- DDRA=0xFF;
- DDRC=0xFF;
- lcd_command(0x38);
- _delay_us(100);
- lcd_command(0x38);
- _delay_us(100);
- lcd_command(0x0C);
- _delay_us(100);
- lcd_command(0x06);
- _delay_us(100);
- }
- struct date_time{
- char hour;
- char minute;
- char second;
- char *day_w;
- char day_m;
- char month;
- int year;
- };
- int main(void)
- {
- /* Replace with your application code */
- lcd_init();
- lcd_clear();
- lcd_text("HELLO WORLD!");
- lcd_xy(1,2);
- lcd_text("ATMEGA644P-20PU");
- lcd_xy(1,3);
- lcd_text("TC1604A-01A 16x4");
- lcd_xy(1,4);
- lcd_text("Microchip Studio");
- _delay_ms(5000);
- lcd_clear();
- struct date_time my_date={10,30,10,
- "Wed",28,1,2026};
- char date[16];
- lcd_xy(1,1);
- lcd_text("Date:");
- sprintf(date,"%s %02d/%02d/%04d",
- my_date.day_w,my_date.day_m,
- my_date.month,my_date.year);
- lcd_xy(1,2);
- lcd_text(date);
- lcd_xy(1,3);
- lcd_text("Time:");
- sprintf(date,"%02d:%02d:%02d",
- my_date.hour,my_date.minute,
- my_date.second);
- lcd_xy(1,4);
- lcd_text(date);
- while (1)
- {
- }
- }
Proteus VSM also has a model for this old LCD module.
![]() |
| Schematic and Simulation |
I wire the example program on my AVR Prototype Board with additional wiring on bread since this LCD is not on my AVR Prototype Board.

I have been using PCBWay for many years now. PCBWay fabricate PCBs at low cost, fast processing time for only 24 hours, and fast delivery time using any carrier options. This double side 10cmx10cm can be fabricate at only 5USD for 5 to 10pcs by PCBWay. It's a standard PCB with silk screen and solder mask.
![]() |
| 10 PCBs for only 5USD |
For different size of PCB we can instantly quote on PCBWay website using a zip PCB Gerber file without account.
![]() |
| PCBWay Instant Quote |
ATMega644P 1602A 16x2 LCD Interfacing
I place a 16x2 LCD on my AVR Prototype Board. I use a 4-bit data transfer mode to save pin counts. The ATMega644P and the 1602A are wired as follow:
- LCD RS(Register Select) connects to PC2.
- LCD RW(Read/Write) connects to GND.
- LCD EN(Enable) connects to PC3.
- LCD D7:4 connects to PC7:4 (4-bit data bus).
Source Code:
- /*
- * 6-hd44780_1602_4.c
- *
- * Created: 1/27/2026 10:25:31 PM
- * Author : Admin
- */
- #include <avr/io.h>
- #include <stdio.h>
- #include <util/delay.h>
- #define F_CPU 16000000UL
- #define RS 2
- #define EN 3
- const char d_time=50;
- void lcd_command(char command){
- char temp;
- temp=command&0xF0;
- PORTC=temp|(1<<EN);
- _delay_us(d_time);
- PORTC=temp;
- _delay_us(d_time);
- temp=command<<4;
- PORTC=temp|(1<<EN);
- _delay_us(d_time);
- PORTC=temp;
- _delay_us(d_time);
- }
- void lcd_data(char data){
- char temp;
- temp=data&0xF0;
- PORTC=temp|(1<<EN)|(1<<RS);
- _delay_us(d_time);
- PORTC=temp|(1<<RS);
- _delay_us(d_time);
- temp=data<<4;
- PORTC=temp|(1<<EN)|(1<<RS);
- _delay_us(d_time);
- PORTC=temp|(1<<RS);
- _delay_us(d_time);
- }
- void lcd_init(void){
- DDRC=0xFF;
- lcd_command(0x33);
- _delay_us(100);
- lcd_command(0x32);
- _delay_us(100);
- lcd_command(0x28);
- _delay_us(100);
- lcd_command(0x0F);
- _delay_us(100);
- lcd_command(0x01);
- _delay_ms(5);
- lcd_command(0x06);
- _delay_us(100);
- }
- void lcd_xy(char x, char y){
- char addr[]={0x80,0xC0};
- lcd_command(addr[y-1]+x-1);
- }
- void lcd_text(char *text){
- while(*text) lcd_data(*text++);
- }
- void lcd_clear(void){
- lcd_command(0x01);
- _delay_ms(5);
- }
- int main(void)
- {
- /* Replace with your application code */
- lcd_init();
- lcd_text("ATMega644P-20PU");
- lcd_xy(1,2);
- lcd_text("Microchip Studio");
- _delay_ms(10000);
- lcd_clear();
- lcd_command(0x0C);
- DDRA=0x00;
- PINA=0xFF;
- char data=0,data_old,temp[16];
- while (1)
- {
- data=PINA;
- if(data!=data_old){
- lcd_xy(1,1);
- sprintf(temp,"HEX: 0x%02X D: %3d",data,data);
- lcd_text(temp);
- for(char i=0;i<sizeof(temp);i++) temp[i]=0;
- for (char i=0;i<8;i++)
- {
- if(data&(1<<i)) temp[7-i]='1';
- else temp[7-i]='0';
- }
- lcd_xy(1,2); lcd_text("BIN: "); lcd_text(temp);
- }
- data_old=data;
- }
- }
Schematic and Simulation:
I tested this demo example on my AVR Prototype Board.
![]() |
| I tested this demo example on my AVR Prototype Board. |
![]() |
| I tested this demo example on my AVR Prototype Board. |
![]() |
| I tested this demo example on my AVR Prototype Board. |











No comments:
Post a Comment