OpenCores
URL https://opencores.org/ocsvn/16x2_lcd_controller/16x2_lcd_controller/trunk

Subversion Repositories 16x2_lcd_controller

[/] [16x2_lcd_controller/] [trunk/] [lcd16x2_ctrl.vhd] - Diff between revs 7 and 10

Show entire file | Details | Blame | View Log

Rev 7 Rev 10
Line 4... Line 4...
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- File       : lcd16x2_ctrl.vhd
-- File       : lcd16x2_ctrl.vhd
-- Author     :   <stachelsau@T420>
-- Author     :   <stachelsau@T420>
-- Company    : 
-- Company    : 
-- Created    : 2012-07-28
-- Created    : 2012-07-28
-- Last update: 2012-07-29
-- Last update: 2012-11-28
-- Platform   : 
-- Platform   : 
-- Standard   : VHDL'93/02
-- Standard   : VHDL'93/02
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Description: The controller initializes the display when rst goes to '0'.
-- Description: The controller initializes the display when rst goes to '0'.
--              After that it writes the contend of the input signals
--              After that it writes the contend of the input signals
Line 60... Line 60...
    rs      : std_logic;
    rs      : std_logic;
    data    : std_logic_vector(7 downto 0);
    data    : std_logic_vector(7 downto 0);
    delay_h : integer range 0 to MAX_DELAY;
    delay_h : integer range 0 to MAX_DELAY;
    delay_l : integer range 0 to MAX_DELAY;
    delay_l : integer range 0 to MAX_DELAY;
  end record op_t;
  end record op_t;
  constant default         : op_t := (rs => '1', data => X"00", delay_h => DELAY_NIBBLE, delay_l => DELAY_40_US);
  constant default_op      : op_t := (rs => '1', data => X"00", delay_h => DELAY_NIBBLE, delay_l => DELAY_40_US);
  constant op_select_line1 : op_t := (rs => '0', data => X"80", delay_h => DELAY_NIBBLE, delay_l => DELAY_40_US);
  constant op_select_line1 : op_t := (rs => '0', data => X"80", delay_h => DELAY_NIBBLE, delay_l => DELAY_40_US);
  constant op_select_line2 : op_t := (rs => '0', data => X"C0", delay_h => DELAY_NIBBLE, delay_l => DELAY_40_US);
  constant op_select_line2 : op_t := (rs => '0', data => X"C0", delay_h => DELAY_NIBBLE, delay_l => DELAY_40_US);
 
 
  -- init + config operations:
  -- init + config operations:
  -- write 3 x 0x3 followed by 0x2
  -- write 3 x 0x3 followed by 0x2
Line 115... Line 115...
 
 
  proc_state : process(state, op_state, ptr, line1_buffer, line2_buffer) is
  proc_state : process(state, op_state, ptr, line1_buffer, line2_buffer) is
  begin
  begin
    case state is
    case state is
      when RESET =>
      when RESET =>
        this_op    <= default;
        this_op    <= default_op;
        next_state <= CONFIG;
        next_state <= CONFIG;
        next_ptr   <= config_ops_t'high;
        next_ptr   <= config_ops_t'high;
 
 
      when CONFIG =>
      when CONFIG =>
        this_op    <= config_ops(ptr);
        this_op    <= config_ops(ptr);
Line 140... Line 140...
        else
        else
          next_state <= SELECT_LINE1;
          next_state <= SELECT_LINE1;
        end if;
        end if;
 
 
      when WRITE_LINE1 =>
      when WRITE_LINE1 =>
        this_op      <= default;
        this_op      <= default_op;
        this_op.data <= line1_buffer(ptr*8 + 7 downto ptr*8);
        this_op.data <= line1_buffer(ptr*8 + 7 downto ptr*8);
        next_ptr     <= ptr;
        next_ptr     <= ptr;
        next_state   <= WRITE_LINE1;
        next_state   <= WRITE_LINE1;
        if op_state = DONE then
        if op_state = DONE then
          next_ptr <= ptr - 1;
          next_ptr <= ptr - 1;
Line 161... Line 161...
        else
        else
          next_state <= SELECT_LINE2;
          next_state <= SELECT_LINE2;
        end if;
        end if;
 
 
      when WRITE_LINE2 =>
      when WRITE_LINE2 =>
        this_op      <= default;
        this_op      <= default_op;
        this_op.data <= line2_buffer(ptr*8 + 7 downto ptr*8);
        this_op.data <= line2_buffer(ptr*8 + 7 downto ptr*8);
        next_ptr     <= ptr;
        next_ptr     <= ptr;
        next_state   <= WRITE_LINE2;
        next_state   <= WRITE_LINE2;
        if op_state = DONE then
        if op_state = DONE then
          next_ptr <= ptr - 1;
          next_ptr <= ptr - 1;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.