Wednesday, August 24, 2016

LCD Interfacing 4 and 8 bit mode library for AVR ATMega328

OnLCDLib - LCD Library written in C for AVR Microcontrollers


I have written a library (OnLCDLib) for interfacing Standard Alpha Numeric LCD Modules with AVR microcontrollers, for those who don’t use Arduino for different reasons. This type of LCD modules come in many different sizes and I’ve tried to make the library work with many of them, such as 16x1, 16x2, 16x4, 20x4, 20x2, 32x2, 40x2 LCD displays.
Next I will give an example of how to connect ATmega328 microcontroller with an 16x2 LCD module. 

Hardware interfacing ATmega328 microcontroller with an 16x2 LCD module with PWM brightness control

This LCD modules can be connected in 4 bit mode or 8 bit mode. Using 4 bit mode is recommended because it uses less pins but the code is a bit more complex. In the following example I use 4 bit mode.

Hardware interfacing AVR ATmega328 with an 16x2 LCD module with PWM brightness control


AddToAny

Related Posts Plugin for WordPress, Blogger...