xilinx1001
Member level 3
- Joined
- Apr 3, 2013
- Messages
- 60
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,781
Hi,
I need to send 2 bytes of data thorough uart.
But by standard protocol I can send only 1 byte of data.
I am using some code like this for send 1 byte.
when I am trying to send 2 bytes of data, I should again go to stReceive from stStop.
But when I am trying it the uart data is transmitting continuously
Can anyone suggest me, how can I do that for transmitting 2 bytes of data
Thanks in adavance
xilinx1001
I need to send 2 bytes of data thorough uart.
But by standard protocol I can send only 1 byte of data.
I am using some code like this for send 1 byte.
Code:
process (stCur, rdaSig, dboutsig,tClk1)
begin
case stCur is
-------------------------------------------------------------------------
--
--Title: stReceive state
--
--Description: This state waits for the UART to receive data. While in
-- this state, the rdSig and wrSig are held low to keep the
-- UART from transmitting any data. Once the rdaSig is set
-- high, data has been received, and is safe to transmit. At
-- this time, the stSend state is loaded, and the dbOutSig
-- is copied to the dbInSig in order to transmit the newly
-- acquired parallel information.
-------------------------------------------------------------------------
when stReceive =>
rdSig <= '0';
wrSig <= '0';
-- if rdaSig = '1' then
if(dbOutSig= x"73")then
-- trig1<='1';
dbInSig <=distance(7 downto 0);
stNext <= stSend;
elsif(dbOutSig= x"74")then
-- trig2<='1';
dbInSig <=distance2(7 downto 0);
stNext <= stSend;
else
stNext<=stReceive;
end if;
-------------------------------------------------------------------------
--
--Title: stSend state
--
--Description: This state tells the UART to send the parallel
-- information found in dbInSig. It does this by strobing
-- both the rdSig and wrSig signals high. Once these
-- signals have been strobed high, the stReceive state is
-- loaded.
--
-------------------------------------------------------------------------
when stSend =>
rdSig <= '0';
wrSig <= '1';
stNext <= stStop;
when stStop =>
wrSig <= '0';
end case;
end process;
end Behavioral;
when I am trying to send 2 bytes of data, I should again go to stReceive from stStop.
But when I am trying it the uart data is transmitting continuously
Can anyone suggest me, how can I do that for transmitting 2 bytes of data
Thanks in adavance
xilinx1001