32 bit data transmitt through rs232 protocol

OP (Company: google) #5155499
Rate this post
• ▲ useful
▼ not useful
I am new in VHDL programming. I have an output of counter of 32-bit 
data. Now I want to transmit the 32 bit through the rs232 protocol which 
can send 8-bit data once. I am attaching my UART file, DCFIFO of 32 to 
8-bit mix file baud rate generator file and the counter file. Can 
anybody help me how to port map them to get 32-bit data transmitted?
Attached files:
Guest #5165163
Rate this post
• ▲ useful
▼ not useful
I would suggest a state machine to control the transmisson:
1
type transmit_state_t is (IDLE, BYTE0, BYTE1, BYTE2, BYTE3, STOP);
2

3
constant STX : natural := 2;    -- start of text
4
constant ETX : natural := 3;    -- end of text
5

6
...
7

8
tx_enable      <= '0';
9

10
case transmit_state is
11

12
    when IDLE =>
13
        if new_data then
14
            tx_enable      <= '1';
15
            tx_data        <= to_unsigned( STX, tx_data'length);
16
            transmit_state <= BYTE0;
17
        end if;
18

19
    when BYTE0 =>
20
         tx_enable      <= '1';
21
         tx_data        <= data( 7 downto 0);
22
         transmit_state <= BYTE1;
23
...
24
    when STOP =>
25
         tx_enable      <= '1';
26
         tx_data        <= to_unsigned( ETX, tx_data'length);
27
         transmit_state <= IDLE;
28

29
end case;
30

31
...

I add STX and ETX to get a chance to synchronice the whole sequence on 
the receiver.

Duke

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.