electrobuz
Member level 2
- Joined
- May 20, 2013
- Messages
- 46
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,638
The problem is sending a changing signal as an attribute to the function. When I call the function, the value send to the function is the instantaneous value of the signal. But what happens when the signal changes (i.e sending the CLK as and attribute), is this reflected in the function or do I have to call the function again?
I want to call it multiple times for receiving data at different times.
Thanks
It will be included as a component but still there will be a receive 'process' which will control the signal to be send to UART_receive, i.e a process which will be invoked when new data is comming. (It can have something like UART_BUSY or UART_COMPLETE signals in its sensitivity list). Right?UART would not be a process, it would be a component
case comm_state is
when idle=>
if DATA_RCVD then
comm_state<=s1;
end if;
when s1 =>
--latch the data here
-- clear the DATA_RCVD flag by reading the data or some other mechanism
...
PROCESS(CLOCK_50,State)
BEGIN
case State is
when 0 => --idle
if DATA_RCVD = '1' then
State <= 1;
end if;
when 1 =>
D1 <= RX_DATA;
State <= 2;
when 2 =>
D2 <= RX_DATA;
when others => NULL;
end case;
END PROCESS;
instead of posting code snippets that dont match the errors your report, how about posting the whole code so we can have a look?
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
ENTITY UART IS
PORT(
CLOCK_50: IN STD_LOGIC;
--D: INOUT STD_LOGIC_VECTOR(7 downto 0);
--KEY: IN STD_LOGIC; --pressed for transmission
LED:OUT STD_LOGIC_VECTOR(7 downto 0);
--UART_TXD:OUT STD_LOGIC;
UART_RXD:IN STD_LOGIC
);
END UART;
ARCHITECTURE MAIN OF UART IS
--SIGNAL TX_DATA: STD_LOGIC_VECTOR(7 downto 0);
--SIGNAL TX_START: STD_LOGIC:='0';
--SIGNAL TX_BUSY: STD_LOGIC;
SIGNAL RX_DATA: STD_LOGIC_VECTOR(7 DOWNTO 0);
SIGNAL RX_BUSY: STD_LOGIC;
SIGNAL DATA_RCVD: std_logic;
SIGNAL D,D1,D2,D3: std_logic_vector(7 downto 0);
SIGNAL Flag1: std_logic:='0';
SIGNAL State: integer:=0;
COMPONENT RX
PORT(
CLK:IN STD_LOGIC;
RX_LINE:IN STD_LOGIC;
DATA:OUT STD_LOGIC_VECTOR(7 downto 0);
BUSY:OUT STD_LOGIC;
DATA_RCVD: out std_logic
);
END COMPONENT RX;
------------------------------------------------------
BEGIN
--C1: TX PORT MAP (CLOCK_50,TX_START,TX_BUSY,TX_DATA,UART_TXD);
C1: RX PORT MAP (CLOCK_50,UART_RXD,RX_DATA,RX_BUSY,DATA_RCVD);
PROCESS(CLOCK_50,State)
BEGIN
case State is
when 0 => --idle
if DATA_RCVD = '1' then
State <= 1;
end if;
when 1 =>
--if DATA_RCVD = '1' then
D1 <= RX_DATA;
State <= 2;
--else
--State <= 0;
--end if;
when 2 =>
-- if DATA_RCVD = '1' then
D2 <= RX_DATA;
-- end if;
when others => NULL;
end case;
END PROCESS;
PROCESS
BEGIN
D3 <= D1 or D2;
LED <= D3;
end process ;
END MAIN;
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?