Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LCD interfacing with FPGA using SPI

Status
Not open for further replies.

Sam Cristtina

Junior Member level 1
Joined
May 13, 2012
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,380
Hello sir,
I'm new in verilog.
I want to displaying character on LCD.
I have done in C language using controller. Now i want to move displaying function on FPGA.
Can any one help me for displaying character on LCD with verilog using SPI?

My code is given in attechment. from attechment u think that i'm new in verilog..

In c language
For writing 'A' on lcd, I transmitting 0x0c41 and 0x0d00.

0x0c00 and 0x0d00 used for EN and reset. SO i transmitting this as DATA in SPI.

can any one help me for doing this using FPGA with verilog code?

Thanks,
 

Attachments

  • New Text Document.txt
    825 bytes · Views: 86

First initialize the LCD display then clear it and come to first line and character.
Send your character with increment in position value
 

You need to follow the initialization sequence for your LCD interface. Timing has to be followed according to datasheet's timing diagram for LCD Enable, Register Select, Read Write & Data bits. You may use a state machine running on SPI clock.

After initialization sequence data can be sent to LCD.

Below is an example init seq for 4-bit LCD interface

Code:
--The initialization sequence first establishes that the FPGA application wishes to use the
--four-bit data interface to the LCD as follows:
--1. Wait 15 ms or longer, although the display is generally ready when the FPGA finishes
--configuration. The 15 ms interval is 750,000 clock cycles at 50 MHz.
--2. Write LCD_DB<7:4> = 0x3, and pulse LCD_E High for 12 clock cycles.
--3. Wait 4.1 ms or longer, which is 205,000 clock cycles at 50 MHz.
--4. Write LCD_DB<7:4> = 0x3, and pulse LCD_E High for 12 clock cycles.
--5. Wait 100 ?s or longer, which is 5,000 clock cycles at 50 MHz.
--6. Write LCD_DB<7:4> = 0x3, and pulse LCD_E High for 12 clock cycles.
--7. Wait 40 ?s or longer, which is 2,000 clock cycles at 50 MHz.
--8. Write LCD_DB<7:4> = 0x2, and pulse LCD_E High for 12 clock
--9. Wait 40 ?s or longer, which is 2,000 clock cycles at 50 MHz.

Hope this helps
 

I have done this all using C language with controller and i also display character using controller so I know about command and data. but now i want to move my Graphics LCD fuction on FPGA in verilog code.
is it possible to make a constant array from which i locate hex value for displaying character in verilog?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top