I am trying to work on LCD display using VHDL. I want to display the word “TECH”...

Free

50.1K

Verified Solution

Question

Electrical Engineering

Iam trying to work on LCD display using VHDL.
I want to display the word “TECH” and make it blink onLCD.
I need the complete source code
(If anyone helps me and the code works I will offer bonus cashfor it )

Answer & Explanation Solved by verified expert
3.7 Ratings (486 Votes)

#include

HANDLE hComm;

void OpenComm()

{

DCB dcb;

hComm = CreateFile(\"COM1:\", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );

if(hComm==INVALID_HANDLE_VALUE) exit(1);

if(!SetupComm(hComm, 4096, 4096)) exit(1);

if(!GetCommState(hComm, &dcb)) exit(1);

dcb.BaudRate = 115200;

dcb.ByteSize = 8;

dcb.Parity = NOPARITY;

dcb.StopBits = 0;

if(!SetCommState(hComm, &dcb)) exit(1);

}

void CloseComm()

{

CloseHandle(hComm);

}

DWORD WriteComm(char* buf, int len)

{

DWORD nSend;

if(!WriteFile(hComm, buf, len, &nSend, NULL)) exit(1);

return nSend;

}

void WriteCommByte(BYTE b)

{

WriteComm(&b, 1);

}

DWORD ReadComm(char *buf, int len)

{

DWORD nRec;

if(!ReadFile(hComm, buf, len, &nRec, NULL)) exit(1);

return nRec;

}

void main()

{

OpenComm();

// Initialize LCD 16x2

WriteCommByte(0x38);   // Used to select 8 bit mode

WriteCommByte(0x0F); // When display On cursor will be on

WriteCommByte(0x01);   // Clear the content of display

Sleep(2);

// Program for displaying \"TECH\" word

WriteCommByte('T'+0x80);

WriteCommByte('E'+0x80);

WriteCommByte('C'+0x80);

WriteCommByte('H'+0x80);

CloseComm();

}

//END


Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students