MICROCONTROLLERS AND MICROPROCESSORS
LAB REPORT NO
NAME: DANISH RAFAQ, AHSAN ,MUNEEB
SECTION: A
SEMESTER: 5TH
REGISTRATION NO: 17PWMCT0534,0578,0596
SUBMITTED TO: ENGR SHAHBAZ
DATE: 30-DECEMBER -2019
UNIVERSITY OF ENGINEERING AND TECHNOLOGY PESHAWAR
Lab No. 10:
Lcd interfacing
1. Objectives
After successfully completing this lab, students should be able to:
Describe the basic operation of lcd
Interface he lcd with arduino
Code to control and operate the lcd
2. Required Material
I. Arduino UNO board
II. USB Cable
III. Breadboard
IV. Power Supply
V. Computer with Atmel Studio 7.
VI. Lcd display
VII. Potentiometer
3. Background
An LCD is an electronic display module which uses liquid crystal to produce a visible image. The 16×2 LCD
display is a very basic module commonly used in DIYs and circuits. The 16×2 translates o a display 16
characters per line in 2 such lines. In this LCD each character is displayed in a 5×7 pixel matrix. A liquid
crystal display or LCD draws its definition from its name itself. It is combination of two states of matter,
the solid and the liquid. LCD uses a liquid crystal to produce a visible image. ... An LCD is either made up of
an active matrix display grid or a passive display grid. [1]
Flatscreen LCD and plasma screens work in a completely different way. ... In a plasma screen, each pixel is
a tiny fluorescent lamp switched on or off electronically. In an LCD television, the pixels are switched on or
off electronically using liquid crystals to rotate polarized light.[2]
4. Procedure
o first of all we made the schematic model of lab in Proteus.
o Then we uploaded the code to the microcontroller.
o Then we made the circuit on the breadboard accordingly as on proteus.
o Then we connected the circuit to the microcontroller.
Circuit diagram:
Code:
#define F_CPU 16000000UL
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <util/delay.h>
#include "lcd.h"
const uint8_t LCD_initialize[] PROGMEM= "LCD INITIALIZED";
const uint8_t LCD_text[] PROGMEM= "student id";
uint8_t lcd_buffer[17];
uint16_t count;
uint8_t anipos, dir;
int main(void)
{
initialize_LCD();
//LCDcursorOFF();
CopyStringToLCD(LCD_initialize, 0, 0);
_delay_ms(2000);
LCDclr();
CopyStringToLCD(LCD_text,0,0);
count=0;
anipos=0;
LCDGotoXY(anipos,1);
LcdDataWrite('1');
LcdDataWrite('7');
LcdDataWrite('p');
LcdDataWrite('W');
LcdDataWrite('M');
LcdDataWrite('C');
LcdDataWrite('T');
LcdDataWrite('0');
LcdDataWrite('5');
LcdDataWrite('3');
LcdDataWrite('4');
while(1)
{};
}
References:
[1] ‘difinition of lcd’ https://learn-electronics%2F16x2-lcd-pinout-
diagram&usg=AOvVaw0o_IAfKWMBgAztpzoExv-v
[2] ‘lcd interfacing’ https://www.explainthatstuff.com › lcdtv