diff --git a/README b/README --- a/README +++ b/README @@ -21,7 +21,7 @@ | ABOUT | ~~~~~ -LPP's VHD_Lib is a VHDL library, which is target independent and includes a set of scripts for integrating into +LPP's VHD_Lib is a VHDL library which is target independent and includes a set of scripts for integrating into gaisler's grlib and use its features. For setup read instalation section. @@ -61,6 +61,4 @@ All the programs used by the VHD_Lib are license. They all are free software and most of them are covered by the GNU General Public License. -The VHD_Lib itself, meaning all the scripts which are used in the building -process, are covered by the GNU General Public License. diff --git a/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_CFG.vhd b/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_CFG.vhd --- a/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_CFG.vhd +++ b/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_CFG.vhd @@ -36,7 +36,7 @@ constant ClearDSPLY : std_logic_vector( constant FunctionSet : std_logic_vector(7 downto 0):= X"38"; constant RetHome : std_logic_vector(7 downto 0):= X"02"; constant SetEntryMode : std_logic_vector(7 downto 0):= X"06"; -constant DSPL_CTRL : std_logic_vector(7 downto 0):= X"0C"; +constant DSPL_CTRL : std_logic_vector(7 downto 0):= X"0E"; constant CursorON : std_logic_vector(7 downto 0):= X"0E"; constant CursorOFF : std_logic_vector(7 downto 0):= X"0C"; diff --git a/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_DRVR.vhd b/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_DRVR.vhd --- a/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_DRVR.vhd +++ b/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_DRVR.vhd @@ -1,4 +1,4 @@ ------------------------------------------------------------------------------- + ------------------------------------------------------------------------------ -- This file is a part of the LPP VHDL IP LIBRARY -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS -- @@ -35,16 +35,18 @@ -- Additional Comments: -- ---------------------------------------------------------------------------------- + +---TDODO => Clean Enable pulse FSM library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.all; library lpp; use lpp.amba_lcd_16x2_ctrlr.all; - +use lpp.lcd_16x2_cfg.all; entity LCD_16x2_DRIVER is generic( - OSC_Freq_MHz : integer:=60 + OSC_Freq_KHz : integer:=50000 ); Port( reset : in STD_LOGIC; @@ -57,11 +59,129 @@ end LCD_16x2_DRIVER; architecture Behavioral of LCD_16x2_DRIVER is +type stateT is (idle,Enable0,Enable1,Enable2,tempo); +signal state : stateT; + + +constant trigger_4us : integer := 5; +constant trigger_100us : integer := 100; +constant trigger_4ms : integer := 4200; +constant trigger_20ms : integer := 20000; + + +signal i : integer :=0; +signal reset_i : std_logic := '0'; +signal tempoTRIG : integer :=0; + +signal clk_1us : std_logic; +signal clk_1us_reg : std_logic; + begin + +CLK0: LCD_CLK_GENERATOR + generic map(OSC_Freq_KHz) + Port map( clk,reset,clk_1us); + + + +process(clk_1us,reset_i) +begin + if reset_i = '0' then + i <= 0; + elsif clk_1us'event and clk_1us ='1' then + i <= i+1; + end if; +end process; + +LCD_CTRL.LCD_RW <= '0'; + +process(clk,reset) +begin + if reset = '0' then + state <= idle; + LCD_CTRL.LCD_E <= '0'; + SYNCH.DRVR_READY <= '0'; + SYNCH.LCD_INITIALISED <= '0'; + reset_i <= '0'; + elsif clk'event and clk = '1' then + case state is + when idle => + SYNCH.LCD_INITIALISED <= '1'; + LCD_CTRL.LCD_E <= '0'; + if DRIVER_CMD.Exec = '1' then + state <= Enable0; + reset_i <= '1'; + SYNCH.DRVR_READY <= '0'; + LCD_CTRL.LCD_DATA <= DRIVER_CMD.Word; + LCD_CTRL.LCD_RS <= DRIVER_CMD.CMD_Data; + case DRIVER_CMD.Duration is + when Duration_4us => + tempoTRIG <= trigger_4us; + when Duration_100us => + tempoTRIG <= trigger_100us; + when Duration_4ms => + tempoTRIG <= trigger_4ms; + when Duration_20ms => + tempoTRIG <= trigger_20ms; + when others => + tempoTRIG <= trigger_20ms; + end case; + else + SYNCH.DRVR_READY <= '1'; + reset_i <= '0'; + end if; + when Enable0 => + if i = 1 then + reset_i <= '0'; + LCD_CTRL.LCD_E <= '1'; + state <= Enable1; + else + reset_i <= '1'; + LCD_CTRL.LCD_E <= '0'; + end if; + when Enable1 => + if i = 2 then + reset_i <= '0'; + LCD_CTRL.LCD_E <= '0'; + state <= Enable2; + else + reset_i <= '1'; + LCD_CTRL.LCD_E <= '1'; + end if; + when Enable2 => + if i = 1 then + reset_i <= '0'; + LCD_CTRL.LCD_E <= '0'; + state <= tempo; + else + reset_i <= '1'; + LCD_CTRL.LCD_E <= '0'; + end if; + when tempo => + if i = tempoTRIG then + reset_i <= '0'; + state <= idle; + else + reset_i <= '1'; + end if; + end case; + end if; +end process; + end Behavioral; + + + + + + + + + + diff --git a/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_ENGINE.vhd b/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_ENGINE.vhd --- a/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_ENGINE.vhd +++ b/lib/lpp/amba_lcd_16x2_ctrlr/LCD_16x2_ENGINE.vhd @@ -153,12 +153,12 @@ begin DRIVER_CMD.Duration <= Duration_100us; DRIVER_CMD.CMD_Data <= '1'; DRIVER_CMD.Word <= DATA(i*8+7 downto i*8); - i <= i + 1; state <= Refresh0; else DRIVER_CMD.Exec <= '0'; end if; when Refresh0=> + i <= i + 1; state <= Refresh1; DRIVER_CMD.Exec <= '0'; when Refresh1=> @@ -205,7 +205,7 @@ begin DRIVER_CMD.Exec <= '1'; DRIVER_CMD.Duration <= Duration_4ms; DRIVER_CMD.CMD_Data <= '0'; - DRIVER_CMD.Word <= X"02"; + DRIVER_CMD.Word <= RetHome; state <= Idle; else DRIVER_CMD.Exec <= '0'; diff --git a/lib/lpp/amba_lcd_16x2_ctrlr/Top_LCD.vhd b/lib/lpp/amba_lcd_16x2_ctrlr/Top_LCD.vhd --- a/lib/lpp/amba_lcd_16x2_ctrlr/Top_LCD.vhd +++ b/lib/lpp/amba_lcd_16x2_ctrlr/Top_LCD.vhd @@ -83,13 +83,12 @@ LCD_CS2 <= '0'; SF_CE0 <= '1'; -rst <= not reset; Driver0 : LCD_16x2_ENGINE generic map(50000) - Port map(clk,rst,FramBUFF,CMD,Exec,Ready,LCD_CTRL); + Port map(clk,reset,FramBUFF,CMD,Exec,Ready,LCD_CTRL); FramBUFF(0*8+7 downto 0*8) <= X"41" when Bp0 = '1' else X"42" when Bp1 = '1' else diff --git a/lib/lpp/dirs.txt b/lib/lpp/dirs.txt --- a/lib/lpp/dirs.txt +++ b/lib/lpp/dirs.txt @@ -1,3 +1,4 @@ -./dsp/iir_filter ./general_purpose ./lpp_amba +./dsp/iir_filter +./amba_lcd_16x2_ctrlr diff --git a/lib/lpp/dsp/iir_filter/vhdlsyn.txt b/lib/lpp/dsp/iir_filter/vhdlsyn.txt --- a/lib/lpp/dsp/iir_filter/vhdlsyn.txt +++ b/lib/lpp/dsp/iir_filter/vhdlsyn.txt @@ -1,12 +1,12 @@ APB_IIR_CEL.vhd -FILTER.vhd -FILTER_RAM_CTRLR.vhd FILTERcfg.vhd FilterCTRLR.vhd +FILTER_RAM_CTRLR.vhd +FILTER.vhd IIR_CEL_CTRLR.vhd IIR_CEL_FILTER.vhd -RAM.vhd +iir_filter.vhd RAM_CEL.vhd RAM_CTRLR2.vhd +RAM.vhd Top_Filtre_IIR.vhd -iir_filter.vhd diff --git a/lib/lpp/general_purpose/vhdlsyn.txt b/lib/lpp/general_purpose/vhdlsyn.txt --- a/lib/lpp/general_purpose/vhdlsyn.txt +++ b/lib/lpp/general_purpose/vhdlsyn.txt @@ -1,13 +1,13 @@ +Adder.vhd ADDRcntr.vhd ALU.vhd -Adder.vhd -MAC.vhd +general_purpose.vhd MAC_CONTROLER.vhd +MAC_MUX2.vhd MAC_MUX.vhd -MAC_MUX2.vhd MAC_REG.vhd +MAC.vhd +Multiplier.vhd MUX2.vhd -Multiplier.vhd REG.vhd Shifter.vhd -general_purpose.vhd