1.3 KiB
1.3 KiB
AVR_ATMEGA_1602LCD
A small library/program for using the 1602 LCD display in 4 bit mode.
Hardware:
- LCD 1602 ADM1602K-NSW-FBS-3.3v or ADM1602K-NSW-FBS-5.0v
- AVR Micro-controller
Supported Controllers:
List of supported controllers:
- ATMega48
- ATMega88
- ATMega168
- ATMega328
Usage:
#include "AVR_ATMEGA_1602LCD.h"
void do_stuff() {
PORTD = 0x00;
DDRD = 0xff;
init_lcd();
return_home_lcd();
set_entry_mode_increment_lcd();
//Refernce the datasheet for charecter codes.
write_lcd_address(0x7f); //Right pointing arrow
//wait a bit.
_delay_ms(1000);
//clear it up
clear_lcd();
return_home_lcd();
//Do more stuff...
}
RoadMap:
- ADD function to print strings
- ADD function to display bit images
- ADD function to act as a loading screen.
- ADD animations
- ADD PWM control for contrast
- ADD PWM control for backlight
ISSUES:
Currently during powerloss events and initialization, long wire runs or residual charge can cause the LCD to maintain memory for a shor duration.
In 4bit mode it's possible to end up with a invalid "nibble" in the LCD memory in this case the system should power cycle the LCD unit assuming it's controlled by the microcontroller.