Wissance / QuickRS232

A versatile full-duplex RS232 FPGA module with internal FIFO buffer on RX

Home Page:https://wissance.github.io/QuickRS232/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix wrong number of data bits

EvilLord666 opened this issue · comments

According to SerialEcho project i discovered one thing: number of Data bits was set incorrect, should as follows:

DATA_BITS_EXCHANGE_STATE:
            begin
                tx <= tx_buffer[tx_data_bit_counter];
                tx_bit_counter <= tx_bit_counter + 1;
                if (tx_bit_counter == TICKS_PER_UART_BIT)
                begin
                    tx_bit_counter <= 0;
                    tx_data_bit_counter <= tx_data_bit_counter + 1;
                    if (tx_data_bit_counter == DEFAULT_BYTE_LEN /*- 1*/)
                    begin
                        tx_state <= PARITY_BIT_EXCHANGE_STATE;
                        tx_data_copied <= 1'b0;
                    end
                end
            end