Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Have to create these LCD functions, I have provided the function declarations as

ID: 3884817 • Letter: H

Question

Have to create these LCD functions, I have provided the function declarations as well as the process. I am using the HDM16116H-L LCD.

In this lab, you will interface with ar LCD to display varigus characters. You will need to create a microsevcrid delay that will work up to at least 2000 micnoseconds using timer D. Using bit shifting and masking you will send commands to the LCD Expected Outcome Hello! Instructions Examine camments in lcd.cpp, main.cpp, and timer.cpp and complate the dascribed functions. You will noad to createa circut using your breadboard. jumper wires and LCDlf you cannot solder, make sure you make solid connections with your LCD using the method described in the video on D2L Requirements Overallg 1. Tha prajet must be pushed toGitab and an appropriate response from the server must be reccived: "Gat your submission. Thanks!" 2 Arduino libranes are not allowed at all for this lab tor the exception ot decug tunctionalty using Senal,printin Tha LCD must laak like that shown in tho axpoctod cutcoms. Icd.cpp 1. All unctions provided must be used in the implementation of the LCD interface acconding to their descriptions 2 PORTAO, PORTA1, PORTA2·and PORTA3 must be used for the d-ta pinson the LCD with PORTO corresponding to the least significant bit PCHUBA and PORT B6 rmust be used for the enable pinnd RS pln respectively, 4 When faur bits need to bo assigned to PORTA, it must be dono in one line of code. Thens are times whene yau need to send four bits twics, in this case, you need twa lines of cods. timer.cpp 1. Implament a procise microsecond timer using timor

Explanation / Answer

#include <REGX51.H>
#include <string.h>
#include <stdio.h>

sfr LCD=0xa0;
sbit EN=P3^6;
sbit RS=P3^7;

voidnop(void);
void delay_1s(unsigned char t);
voidinitial_lcd(void);
void delay(void);
voidstring_to_lcd(unsigned char *s);
voidwrite_lcd(unsigned char dat,unsignedint com);
void delay_50ms(unsigned char x);

void main()
{

P0=0xff;
P1=0xff;
P3=0xff;
delay_50ms(4);
initial_lcd();
write_lcd(0x80,0);
string_to_lcd(” WELCOME TO “);
write_lcd(0xc0,0);
string_to_lcd(“INNOVATE ENG SOL”);

}

voidnop(void)
{

unsigned char n;
for(n=0;n<20;n++);

}

//………………delay routine……………..//

void delay_1s(unsigned char t)
{

unsigned char i,j;
for(i=0;i<t;i++)

{

for(j=0;j<20;j++)

{

TMOD=0x01;
TH0=0x3c; //for 12MHz (12/12MHZ)=1u>per cycle operation
TL0=0xb0; //50ms delay get (50m/1u)=50000;
TR0=1; //Load value is =65536-50000=15536(=3cb0H)

while(TF0!=1); //wait for overflow flag
TF0=0;

}

}

}

voidinitial_lcd(void)
{

write_lcd(0x38,0);
write_lcd(0x0c,0);
write_lcd(0x01,0);

}

voidwrite_lcd(unsigned char dat,unsignedint com)
{

RS=com;
LCD=dat;nop();
EN=1;nop();
EN=0;
nop();

}

voidstring_to_lcd(unsigned char *s)

{

unsigned char i,l;
l=strlen(s);
for(i=0;i<l;i++)

{

write_lcd(*s,1);delay_50ms(1);
s++;

}

}

void delay_50ms(unsigned char x)
{

unsigned char i;
for(i=0;i<x;i++)

{

TMOD=0x01;
TH0=0x3c;
TL0=0xb0;
TR0=1;
while(!TF0);
TF0=0;
TR0=0;

}

}

******************************** SECOND DEMO CODE*****************************

#include<reg51.h>
#define cmdport P3
#define dataport P2
#define q 100

sbitrs = cmdport^0; //register select pin
sbitrw = cmdport^1; //read write pin
sbit e = cmdport^6; //enable pin

void delay(unsigned intmsec) //Function to provide time delay in msec.

{

inti,j ;
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);

}

voidlcdcmd(unsigned char item) //Function to send command to LCD

{

dataport = item;
rs= 0;
rw=0;
e=1;
delay(1);
e=0;

}

voidlcddata(unsigned char item) //Function to send data to LCD

{

dataport = item;
rs= 1;
rw=0;
e=1;
delay(1);
e=0;

}

void main()

{

lcdcmd(0x38); //for using 8-bit 2 row mode of LCD
delay(100);
lcdcmd(0x0E); //turn display ON for cursor blinking
delay(100);
lcdcmd(0x01); //clear screen
delay(100);
lcdcmd(0x06); //display ON
delay(100);
lcdcmd(0x86); //bring cursor to position 6 of line 1
delay(100);
lcddata(‘A’);

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote