basab
Newbie level 3
- Joined
- Dec 6, 2011
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Guwahati, India, India
- Activity points
- 1,315
Hi I am facing a unusual problem when implementing a RS232 transmitter problem. I have written a VHDL script which includes a UART component form Digilent. Problem is that logically my program should send the letter 'A' then 'B' then 'C' and then 'D' and the process should repeat. But upon programming the Chip with bit file, the program transmit only 'B' and 'D' and repeat the same in Hyperterminal. I am not getting why its not transmitting what is expected i.e. A B C D repeatedly. Please guide me where I am going wrong.
in the process code below:
sys_clk is the clock signal
reset is always 0 for my case
CLKp is signal which remains high for total time while transmitting ABCD and goes low once RST is made zero 0.
in the process code below:
sys_clk is the clock signal
reset is always 0 for my case
CLKp is signal which remains high for total time while transmitting ABCD and goes low once RST is made zero 0.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 tx_output: process (sys_clk,reset,CLKp) is variable opbits1: std_logic_vector(7 downto 0); variable opbits2: std_logic_vector(7 downto 0); variable opbits3: std_logic_vector(7 downto 0); variable opbits4: std_logic_vector(7 downto 0); begin if CLKp='1' then opbits1:= outputbits(7 downto 0); opbits2:= outputbits(15 downto 8); opbits3:= outputbits(23 downto 16); opbits4:= outputbits(31 downto 24); if rising_edge(sys_clk) then if uart_tx_ready ='1' then if lsb=0 then uart_tx_data <= opbits1; ---- should print A uart_tx_enable <='1'; lsb<=lsb+1; elsif lsb=1 then uart_tx_data <= opbits2; ---- should print B uart_tx_enable <='1'; lsb <=lsb+1; elsif lsb=2 then uart_tx_data <= opbits3; ---- should print C uart_tx_enable <='1'; lsb <=lsb+1; elsif lsb=3 then uart_tx_data <= opbits4; ---- should print D uart_tx_enable <='1'; RST <='1'; lsb <=0; end if; else uart_tx_enable <='0'; end if; end if; else RST <='0'; end if; end process;
Last edited by a moderator: