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

Subversion Repositories apbi2c

[/] [apbi2c/] [trunk/] [rtl/] [module_i2c.v] - Diff between revs 2 and 4

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

Rev 2 Rev 4
Line 24... Line 24...
////
////
////
////
////
////
////
////
//// Author(s): - Felipe Fernandes Da Costa, fefe2560@gmail.com
//// Author(s): - Felipe Fernandes Da Costa, fefe2560@gmail.com
////              Ronal Dario Celaya
////              Ronal Dario Celaya ,rcelaya.dario@gmail.com
////
////
///////////////////////////////////////////////////////////////// 
///////////////////////////////////////////////////////////////// 
////
////
////
////
//// Copyright (C) 2009 Authors and OPENCORES.ORG
//// Copyright (C) 2009 Authors and OPENCORES.ORG
Line 196... Line 196...
 
 
*/
*/
assign SDA = SDA_OUT;
assign SDA = SDA_OUT;
assign SCL = BR_CLK_O;
assign SCL = BR_CLK_O;
 
 
 
//STANDARD ERROR
 
assign ERROR = (DATA_CONFIG_REG[0] == 1'b1 & DATA_CONFIG_REG[1] == 1'b1)?1'b1:1'b0;
 
 
//COMBINATIONAL BLOCK TO TX
//COMBINATIONAL BLOCK TO TX
always@(*)
always@(*)
begin
begin
 
 
Line 213... Line 215...
                //OBEYING SPEC
                //OBEYING SPEC
                if(DATA_CONFIG_REG[0] == 1'b0 && fifo_tx_f_full == 1'b0 && DATA_CONFIG_REG[1] == 1'b0)
                if(DATA_CONFIG_REG[0] == 1'b0 && fifo_tx_f_full == 1'b0 && DATA_CONFIG_REG[1] == 1'b0)
                begin
                begin
                        next_state_tx = TX_IDLE;
                        next_state_tx = TX_IDLE;
                end
                end
                else
                else if(DATA_CONFIG_REG[0] == 1'b1 && fifo_tx_f_full == 1'b1 && DATA_CONFIG_REG[1] == 1'b1)
 
                begin
 
                        next_state_tx = TX_IDLE;
 
                end
 
                else if(DATA_CONFIG_REG[0] == 1'b1 && fifo_tx_f_full == 1'b1 && DATA_CONFIG_REG[1] == 1'b0)
                begin
                begin
                        next_state_tx = TX_START;
                        next_state_tx = TX_START;
                end
                end
 
 
 
 
Line 766... Line 772...
                begin
                begin
 
 
                        fifo_tx_rd_en <= 1'b0;
                        fifo_tx_rd_en <= 1'b0;
 
 
 
 
                        if(DATA_CONFIG_REG[0] == 1'b0 && fifo_tx_f_full == 1'b0)
                        if(DATA_CONFIG_REG[0] == 1'b0 && fifo_tx_f_full == 1'b0 && DATA_CONFIG_REG[1] == 1'b0)
                        begin
                        begin
                                count_send_data <= 12'd0;
                                count_send_data <= 12'd0;
                                SDA_OUT<= 1'b1;
                                SDA_OUT<= 1'b1;
                                BR_CLK_O <= 1'b1;
                                BR_CLK_O <= 1'b1;
                        end
                        end
                        else
                        else if(DATA_CONFIG_REG[0] == 1'b1 && fifo_tx_f_full == 1'b1 && DATA_CONFIG_REG[1] == 1'b0)
                        begin
                        begin
                                count_send_data <= count_send_data + 12'd1;
                                count_send_data <= count_send_data + 12'd1;
                                SDA_OUT<=1'b0;
                                SDA_OUT<=1'b0;
                        end
                        end
 
                        else if(DATA_CONFIG_REG[0] == 1'b1 && fifo_tx_f_full == 1'b1 && DATA_CONFIG_REG[1] == 1'b1)
 
                        begin
 
                                count_send_data <= 12'd0;
 
                                SDA_OUT<= 1'b1;
 
                                BR_CLK_O <= 1'b1;
 
                        end
 
 
                end
                end
                TX_START:
                TX_START:
                begin
                begin
 
 

powered by: WebSVN 2.1.0

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