OpenCores
URL https://opencores.org/ocsvn/apbi2c/apbi2c/trunk

Subversion Repositories apbi2c

[/] [apbi2c/] [trunk/] [rtl/] [module_i2c.v] - Diff between revs 6 and 7

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 6 Rev 7
Line 794... Line 794...
                                BR_CLK_O <= 1'b0;
                                BR_CLK_O <= 1'b0;
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                        end
                        end
 
 
                        if(count_send_data == DATA_CONFIG_REG[13:2]- 12'd1)
                        if(count_send_data == DATA_CONFIG_REG[13:2]- 12'd1)
                        begin
                        begin
                                SDA_OUT<=fifo_tx_data_out[0:0];
                                SDA_OUT<=fifo_tx_data_out[0:0];
Line 815... Line 814...
                        begin
                        begin
 
 
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[0:0];
                                SDA_OUT<=fifo_tx_data_out[0:0];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[1:1];
                                SDA_OUT<=fifo_tx_data_out[1:1];
                        end
                        end
 
 
 
 
                end
                end
Line 844... Line 847...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[1:1];
                                SDA_OUT<=fifo_tx_data_out[1:1];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[2:2];
                                SDA_OUT<=fifo_tx_data_out[2:2];
                        end
                        end
 
 
                end
                end
 
 
Line 872... Line 878...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[2:2];
                                SDA_OUT<=fifo_tx_data_out[2:2];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[3:3];
                                SDA_OUT<=fifo_tx_data_out[3:3];
                        end
                        end
 
 
 
 
 
 
Line 901... Line 910...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[3:3];
                                SDA_OUT<=fifo_tx_data_out[3:3];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[4:4];
                                SDA_OUT<=fifo_tx_data_out[4:4];
                        end
                        end
 
 
                end
                end
 
 
Line 929... Line 941...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[4:4];
                                SDA_OUT<=fifo_tx_data_out[4:4];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[5:5];
                                SDA_OUT<=fifo_tx_data_out[5:5];
                        end
                        end
 
 
                end
                end
 
 
Line 956... Line 971...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[5:5];
                                SDA_OUT<=fifo_tx_data_out[5:5];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[6:6];
                                SDA_OUT<=fifo_tx_data_out[6:6];
                        end
                        end
 
 
 
 
                end
                end
Line 983... Line 1001...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[6:6];
                                SDA_OUT<=fifo_tx_data_out[6:6];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[7:7];
                                SDA_OUT<=fifo_tx_data_out[7:7];
                        end
                        end
 
 
 
 
                end
                end
Line 1009... Line 1030...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[7:7];
                                SDA_OUT<=fifo_tx_data_out[7:7];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<= 1'b0;
                                SDA_OUT<= 1'b0;
                        end
                        end
 
 
 
 
                end
                end
Line 1037... Line 1061...
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
 
 
                                //LETS TRY USE THIS BUT I DONT THINK IF WORKS  
                                //LETS TRY USE THIS BUT I DONT THINK IF WORKS  
                                RESPONSE<= SDA;
                                RESPONSE<= SDA;
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
Line 1061... Line 1089...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[8:8];
                                SDA_OUT<=fifo_tx_data_out[8:8];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[9:9];
                                SDA_OUT<=fifo_tx_data_out[9:9];
                        end
                        end
 
 
                end
                end
                TX_ADRESS_2:
                TX_ADRESS_2:
Line 1086... Line 1117...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[9:9];
                                SDA_OUT<=fifo_tx_data_out[9:9];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[10:10];
                                SDA_OUT<=fifo_tx_data_out[10:10];
                        end
                        end
 
 
                end
                end
                TX_ADRESS_3:
                TX_ADRESS_3:
Line 1111... Line 1145...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[10:10];
                                SDA_OUT<=fifo_tx_data_out[10:10];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[11:11];
                                SDA_OUT<=fifo_tx_data_out[11:11];
                        end
                        end
 
 
                end
                end
                TX_ADRESS_4:
                TX_ADRESS_4:
Line 1136... Line 1173...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[11:11];
                                SDA_OUT<=fifo_tx_data_out[11:11];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[12:12];
                                SDA_OUT<=fifo_tx_data_out[12:12];
                        end
                        end
                end
                end
                TX_ADRESS_5:
                TX_ADRESS_5:
                begin
                begin
Line 1160... Line 1200...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[12:12];
                                SDA_OUT<=fifo_tx_data_out[12:12];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[13:13];
                                SDA_OUT<=fifo_tx_data_out[13:13];
                        end
                        end
 
 
 
 
                end
                end
Line 1186... Line 1229...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[13:13];
                                SDA_OUT<=fifo_tx_data_out[13:13];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[14:14];
                                SDA_OUT<=fifo_tx_data_out[14:14];
                        end
                        end
 
 
                end
                end
                TX_ADRESS_7:
                TX_ADRESS_7:
Line 1211... Line 1257...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[14:14];
                                SDA_OUT<=fifo_tx_data_out[14:14];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[15:15];
                                SDA_OUT<=fifo_tx_data_out[15:15];
                        end
                        end
 
 
 
 
                end
                end
Line 1237... Line 1286...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[15:15];
                                SDA_OUT<=fifo_tx_data_out[15:15];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                        end
                        end
 
 
                end
                end
                TX_RESPONSE_ADRESS:
                TX_RESPONSE_ADRESS:
                begin
                begin
Line 1262... Line 1314...
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
 
 
                                //LETS TRY USE THIS BUT I DONT THINK IF WORKS  
                                //LETS TRY USE THIS BUT I DONT THINK IF WORKS  
                                RESPONSE<= SDA;
                                RESPONSE<= SDA;
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
Line 1285... Line 1341...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[16:16];
                                SDA_OUT<=fifo_tx_data_out[16:16];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[17:17];
                                SDA_OUT<=fifo_tx_data_out[17:17];
                        end
                        end
 
 
 
 
                end
                end
Line 1311... Line 1370...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[17:17];
                                SDA_OUT<=fifo_tx_data_out[17:17];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[18:18];
                                SDA_OUT<=fifo_tx_data_out[18:18];
                        end
                        end
 
 
 
 
                end
                end
Line 1337... Line 1399...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[18:18];
                                SDA_OUT<=fifo_tx_data_out[18:18];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[19:19];
                                SDA_OUT<=fifo_tx_data_out[19:19];
                        end
                        end
 
 
                end
                end
                TX_DATA0_4:
                TX_DATA0_4:
Line 1362... Line 1427...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[19:19];
                                SDA_OUT<=fifo_tx_data_out[19:19];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[20:20];
                                SDA_OUT<=fifo_tx_data_out[20:20];
                        end
                        end
 
 
                end
                end
                TX_DATA0_5:
                TX_DATA0_5:
Line 1387... Line 1455...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[20:20];
                                SDA_OUT<=fifo_tx_data_out[20:20];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[21:21];
                                SDA_OUT<=fifo_tx_data_out[21:21];
                        end
                        end
 
 
                end
                end
                TX_DATA0_6:
                TX_DATA0_6:
Line 1412... Line 1483...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[21:21];
                                SDA_OUT<=fifo_tx_data_out[21:21];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[22:22];
                                SDA_OUT<=fifo_tx_data_out[22:22];
                        end
                        end
 
 
                end
                end
                TX_DATA0_7:
                TX_DATA0_7:
Line 1437... Line 1511...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[22:22];
                                SDA_OUT<=fifo_tx_data_out[22:22];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[23:23];
                                SDA_OUT<=fifo_tx_data_out[23:23];
                        end
                        end
 
 
                end
                end
                TX_DATA0_8:
                TX_DATA0_8:
Line 1462... Line 1539...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[23:23];
                                SDA_OUT<=fifo_tx_data_out[23:23];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
 
 
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                        end
                        end
 
 
                end
                end
                TX_RESPONSE_DATA0_1:
                TX_RESPONSE_DATA0_1:
                begin
                begin
Line 1489... Line 1569...
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
 
 
                                //LETS TRY USE THIS BUT I DONT THINK IF WORKS  
                                //LETS TRY USE THIS BUT I DONT THINK IF WORKS  
                                RESPONSE<= SDA;
                                RESPONSE<= SDA;
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
Line 1512... Line 1596...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[24:24];
                                SDA_OUT<=fifo_tx_data_out[24:24];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[25:25];
                                SDA_OUT<=fifo_tx_data_out[25:25];
 
 
                        end
                        end
 
 
 
 
Line 1539... Line 1626...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[25:25];
                                SDA_OUT<=fifo_tx_data_out[25:25];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
 
 
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[26:26];
                                SDA_OUT<=fifo_tx_data_out[26:26];
                        end
                        end
 
 
                end
                end
                TX_DATA1_3:
                TX_DATA1_3:
Line 1565... Line 1654...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[26:26];
                                SDA_OUT<=fifo_tx_data_out[26:26];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
 
 
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[27:27];
                                SDA_OUT<=fifo_tx_data_out[27:27];
                        end
                        end
 
 
                end
                end
                TX_DATA1_4:
                TX_DATA1_4:
Line 1591... Line 1683...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[27:27];
                                SDA_OUT<=fifo_tx_data_out[27:27];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
 
 
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[28:28];
                                SDA_OUT<=fifo_tx_data_out[28:28];
                        end
                        end
 
 
                end
                end
                TX_DATA1_5:
                TX_DATA1_5:
Line 1617... Line 1712...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[28:28];
                                SDA_OUT<=fifo_tx_data_out[28:28];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
 
 
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[29:29];
                                SDA_OUT<=fifo_tx_data_out[29:29];
                        end
                        end
 
 
                end
                end
                TX_DATA1_6:
                TX_DATA1_6:
Line 1643... Line 1741...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[29:29];
                                SDA_OUT<=fifo_tx_data_out[29:29];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
 
 
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[30:30];
                                SDA_OUT<=fifo_tx_data_out[30:30];
                        end
                        end
 
 
                end
                end
                TX_DATA1_7:
                TX_DATA1_7:
Line 1669... Line 1770...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[30:30];
                                SDA_OUT<=fifo_tx_data_out[30:30];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
 
 
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                                SDA_OUT<=fifo_tx_data_out[31:31];
                                SDA_OUT<=fifo_tx_data_out[31:31];
                        end
                        end
 
 
 
 
                end
                end
Line 1696... Line 1800...
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=fifo_tx_data_out[31:31];
                                SDA_OUT<=fifo_tx_data_out[31:31];
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
 
 
                        end
                        end
                        else
                        else
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                BR_CLK_O <= 1'b1;
 
                        end
                        end
 
 
                end
                end
                TX_RESPONSE_DATA1_1:
                TX_RESPONSE_DATA1_1:
                begin
                begin
Line 1724... Line 1831...
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
 
 
                                //LETS TRY USE THIS BUT I DONT THINK IF WORKS  
                                //LETS TRY USE THIS BUT I DONT THINK IF WORKS  
                                RESPONSE<= SDA;
                                RESPONSE<= SDA;
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2-12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd4)
 
                                begin
 
                                        BR_CLK_O <= 1'b0;
 
                                end
 
                                else if(count_send_data >= DATA_CONFIG_REG[13:2]/12'd4 && count_send_data < (DATA_CONFIG_REG[13:2]-(DATA_CONFIG_REG[13:2]/12'd4))-12'd1)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
                                        BR_CLK_O <= 1'b1;
                                end
                                end
                                else if(count_send_data > DATA_CONFIG_REG[13:2]/12'd2-12'd1 && count_send_data < DATA_CONFIG_REG[13:2])
                                else
                                begin
                                begin
                                        BR_CLK_O <= 1'b0;
                                        BR_CLK_O <= 1'b0;
                                end
                                end
                        end
                        end
                        else
                        else
Line 1759... Line 1870...
 
 
 
 
                                if(count_tx == 2'd0)
                                if(count_tx == 2'd0)
                                begin
                                begin
                                        count_tx <= count_tx + 2'd1;
                                        count_tx <= count_tx + 2'd1;
                                        BR_CLK_O <= 1'b1;
 
                                        SDA_OUT<=fifo_tx_data_out[8:8];
                                        SDA_OUT<=fifo_tx_data_out[8:8];
                                end
                                end
                                else if(count_tx == 2'd1)
                                else if(count_tx == 2'd1)
                                begin
                                begin
                                        count_tx <= count_tx + 2'd1;
                                        count_tx <= count_tx + 2'd1;
                                        BR_CLK_O <= 1'b1;
 
                                        SDA_OUT<=fifo_tx_data_out[16:16];
                                        SDA_OUT<=fifo_tx_data_out[16:16];
                                end
                                end
                                else if(count_tx == 2'd2)
                                else if(count_tx == 2'd2)
                                begin
                                begin
                                        count_tx <= count_tx + 2'd1;
                                        count_tx <= count_tx + 2'd1;
                                        BR_CLK_O <= 1'b1;
 
                                        SDA_OUT<=fifo_tx_data_out[24:24];
                                        SDA_OUT<=fifo_tx_data_out[24:24];
                                end
                                end
                                else if(count_tx == 2'd3)
                                else if(count_tx == 2'd3)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
 
                                        count_tx <= 2'd0;
                                        count_tx <= 2'd0;
                                end
                                end
 
 
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
 
 
Line 1828... Line 1935...
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
 
 
                                if(count_tx == 2'd0)
                                if(count_tx == 2'd0)
                                begin
                                begin
                                        count_tx <= 2'd0;
                                        count_tx <= 2'd0;
                                        BR_CLK_O <= 1'b1;
 
                                        SDA_OUT<=fifo_tx_data_out[0:0];
                                        SDA_OUT<=fifo_tx_data_out[0:0];
                                end
                                end
                                else if(count_tx == 2'd1)
                                else if(count_tx == 2'd1)
                                begin
                                begin
                                        count_tx <= 2'd1;
                                        count_tx <= 2'd1;
                                        BR_CLK_O <= 1'b1;
 
                                        SDA_OUT<=fifo_tx_data_out[8:8];
                                        SDA_OUT<=fifo_tx_data_out[8:8];
                                end
                                end
                                else if(count_tx == 2'd2)
                                else if(count_tx == 2'd2)
                                begin
                                begin
                                        count_tx <= 2'd2;
                                        count_tx <= 2'd2;
                                        BR_CLK_O <= 1'b1;
 
                                        SDA_OUT<=fifo_tx_data_out[16:16];
                                        SDA_OUT<=fifo_tx_data_out[16:16];
                                end
                                end
                                else if(count_tx == 2'd3)
                                else if(count_tx == 2'd3)
                                begin
                                begin
                                        BR_CLK_O <= 1'b1;
 
                                        count_tx <= 2'd3;
                                        count_tx <= 2'd3;
                                        SDA_OUT<=fifo_tx_data_out[24:24];
                                        SDA_OUT<=fifo_tx_data_out[24:24];
                                end
                                end
 
 
 
 
                        end
                        end
                end
                end
                TX_STOP:
                TX_STOP:
                begin
                begin
 
 
 
                        BR_CLK_O <= 1'b1;
 
 
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        if(count_send_data < DATA_CONFIG_REG[13:2])
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
 
 
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2-12'd2)
                                if(count_send_data < DATA_CONFIG_REG[13:2]/12'd2-12'd2)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.