Академический Документы
Профессиональный Документы
Культура Документы
Submitted to
Prof. P. N. Thakre
Electronics & Communication Engineering
Shri Ramdeobaba College of Engineering & Management, Nagpur 440 013
(An Autonomous Institute affiliated to Rashtrasant Tukdoji Maharaj Nagpur University Nagpur)
2016-17
DESCRIPTION:
VL-FPGA-B includes a LCD Module, which is a dot matrix liquid crystal display that displays alphanumeric,
Kana(Japanese) characters and symbols. Built in controller provides connectivity between LCD and FPGA.
This LCD has a built in Dot Matrix Controller, with font 5 X 7 or 5 X 10 dots, display data RAM for 80 characters (80 x 8
bit) and a character generator ROM which provides 160 characters with 5x7 font and 32 characters with font of 5x10.
All the functions required for LCD are provided internally. Internal refresh is provided by the controller.
FPGA Pin
P167
P166
P165
P162
P161
P156
P155
P154
The control lines of LCD comprise of RS, R/W# and E. The significance of above mentioned control signals is as follows:
RS: Register select signal is used to select data register or command/status register.
High on RS selects the data register
Low on RS selects the command/status register
R/W: Read/write select control lines.
High on R/W# selects the read operation
Low on R/W# selects the write operation
E: Enable signal is used to enable or disable data bus.
Low on the enable signal puts the data bus into a high impedance state.
High on enable signal selects the data bus.
The control line interface of LCD with FPGA is shown in the below table:
Control Bit
LCD_E
LCD_RS
LCD_RW_bar
FPGA Pin
P168
P171
P169
----------------------------------------------------------------------------------------------------------------------------------------------------------------
#Program Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity test_lcd_mod is
port( CLK_4M
: in STD_LOGIC; -- 4 Mhz
RESET
: in STD_LOGIC;
LCD_D
: out STD_LOGIC_VECTOR (7 downto 0);
LCD_RW
: out STD_LOGIC;
LCD_RS
: out STD_LOGIC;
LCD_E
: out STD_LOGIC
--posedge_clk
: out std_logic_vector(7 downto 0)
);
end test_lcd_mod;
architecture Behavioral of test_lcd_mod is
-**************************************************************************************************
**************
-- signal
VHDL Assignment 2 97,98,99,100
case ps_1 is
when func_set0 =>
process(RESET,CLK_4M,refresh,lcd_posedge_s)
begin
if(RESET = '1') then
refresh_d <= '0';
elsif(CLK_4M'event and CLK_4M = '1') then
if(lcd_posedge_s = '1') then
refresh_d <= refresh;
end if;
end if;
end process;
refresh_s <= '1' when (refresh = '1' and refresh_d = '0') else
'0';
--state2
process(RESET,CLK_4M,lcd_posedge_s)
begin
if(RESET = '1') then
prst <= wait_state2;
elsif(CLK_4M'event and CLK_4M = '1') then
if(lcd_posedge_s = '1') then
prst <= nxt;
end if;
end if;
end process;
process(prst,refresh_s)
begin
case prst is
-- loop in wait state2 till the LCD is being Intialized
when wait_state2 =>
if(refresh_s = '1') then
nxt <= idle1;
end if;
when idle1 => nxt <=idle;
when idle => nxt <= A;
when A => nxt <= B;
when B => nxt <= C;
when C => nxt <= D;
when D => nxt <= E;
when E => nxt <= F;
when others => nxt <= wait_state2;
end case;
end process;
--output decoder
VHDL Assignment 2 97,98,99,100
process(prst)
begin
case prst is
when wait_state2 =>
data_s1 <= "0000000000";
when A => data_s1 <= "1001000001";
when B => data_s1 <= "1001000010";
when C => data_s1 <= "1001000011";
when D => data_s1 <= "1001000100";
when E => data_s1 <= "1001000101";
when F => data_s1 <= "1001000110";
when others =>
data_s1 <= "0000000000";
end case;
end process;
LCD_D <= data_s(7 downto 0) or data_s1(7 downto 0);
LCD_RS <= data_s(9) or data_s1(9);
LCD_RW <= data_s(8) or data_s1(8);
LCD_E <= en1 or en2;
end Behavioral;
Output:
RTL Schematic
TECHNOLOGY SCHEMATIC
Summary
Power Analysis
CONCLUSION:
Thus, interfacing of Liquid Crystal Display with Spartan-3 FPGA is done and the FPGA is programmed to display the
characters ABCDEF.