PROC_REGISTERS : process begin
wait until rising_edge(clk_i);
- if WRITE_IN = '1' then
+ if bus_write= '1' then
if uart_addr = x"01" then
lcd_data_i(31 downto 0) <= uart_rx_data;
elsif uart_addr = x"02" then
- lcd_data_i(79 downto 64) <= uart_rx_data;
+ lcd_data_i(79 downto 64) <= uart_rx_data(15 downto 0);
end if;
end if;
end process;
clock_division : process begin
wait until rising_edge(CLK);
-- scaling down the main clock to the desired baudrate
- if clk_div_counter < CLK_DIV-1 then
- clk_div_counter <= clk_div_counter + 1;
- else
+ if clk_div_counter = CLK_DIV-1 then
clk_div_counter <= x"0000";
+ else
+ clk_div_counter <= clk_div_counter + 1;
end if;
-- generates symbol_pulse, a signal that has 1 clock cycle pulses, one symbol duration period apart
-- in contrast to the transceiver module, the symbol pulse is generated in the middle of the
signal tx_send : std_logic;
signal tx_ready : std_logic;
-type rx_state_t is (IDLE,ADDR,GET_BYTE0,GET_BYTE1,GET_BYTE2,GET_BYTE3,DO_WRITE,DO_READ,SEND_BYTE0,SEND_BYTE1,SEND_BYTE2);
+type rx_state_t is (IDLE,GET_ADDR,GET_BYTE0,GET_BYTE1,GET_BYTE2,GET_BYTE3,DO_WRITE,DO_READ,SEND_BYTE0,SEND_BYTE1,SEND_BYTE2);
signal state : rx_state_t;
signal addr : std_logic_vector(7 downto 0) := (others => '0');
signal word : std_logic_vector(31 downto 0) := (others => '0');
cmd_rd <= '0';
cmd_wr <= '0';
if rx_ready = '1' then
- state <= ADDR;
+ state <= GET_ADDR;
if rx_data = x"52" then
cmd_rd <= '1';
elsif rx_data = x"57" then
end if;
end if;
- when ADDR =>
+ when GET_ADDR =>
if rx_ready = '1' then
addr <= rx_data;
if cmd_wr = '1' then
clock_division : process begin
wait until rising_edge(CLK);
-- scaling down the main clock to the desired baudrate
- if clk_div_counter < CLK_DIV-1 then
- clk_div_counter <= clk_div_counter + 1;
- else
+ if clk_div_counter = CLK_DIV-1 then
clk_div_counter <= x"0000";
+ else
+ clk_div_counter <= clk_div_counter + 1;
end if;