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

Subversion Repositories i2c

[/] [i2c/] [trunk/] [rtl/] [verilog/] [i2c_master_bit_ctrl.v] - Diff between revs 36 and 38

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

Rev 36 Rev 38
Line 35... Line 35...
////                                                             ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
 
 
//  CVS Log
//  CVS Log
//
//
//  $Id: i2c_master_bit_ctrl.v,v 1.9 2003-03-10 14:26:37 rherveille Exp $
//  $Id: i2c_master_bit_ctrl.v,v 1.10 2003-08-09 07:01:33 rherveille Exp $
//
//
//  $Date: 2003-03-10 14:26:37 $
//  $Date: 2003-08-09 07:01:33 $
//  $Revision: 1.9 $
//  $Revision: 1.10 $
//  $Author: rherveille $
//  $Author: rherveille $
//  $Locker:  $
//  $Locker:  $
//  $State: Exp $
//  $State: Exp $
//
//
// Change History:
// Change History:
//               $Log: not supported by cvs2svn $
//               $Log: not supported by cvs2svn $
 
//               Revision 1.9  2003/03/10 14:26:37  rherveille
 
//               Fixed cmd_ack generation item (no bug).
 
//
//               Revision 1.8  2003/02/05 00:06:10  rherveille
//               Revision 1.8  2003/02/05 00:06:10  rherveille
//               Fixed a bug where the core would trigger an erroneous 'arbitration lost' interrupt after being reset, when the reset pulse width < 3 clk cycles.
//               Fixed a bug where the core would trigger an erroneous 'arbitration lost' interrupt after being reset, when the reset pulse width < 3 clk cycles.
//
//
//               Revision 1.7  2002/12/26 16:05:12  rherveille
//               Revision 1.7  2002/12/26 16:05:12  rherveille
//               Small code simplifications
//               Small code simplifications
Line 272... Line 275...
 
 
        // generate arbitration lost signal
        // generate arbitration lost signal
        // aribitration lost when:
        // aribitration lost when:
        // 1) master drives SDA high, but the i2c bus is low
        // 1) master drives SDA high, but the i2c bus is low
        // 2) stop detected while not requested
        // 2) stop detected while not requested
        reg cmd_stop, dcmd_stop;
        reg cmd_stop;
        always @(posedge clk or negedge nReset)
        always @(posedge clk or negedge nReset)
          if (~nReset)
          if (~nReset)
            begin
 
                cmd_stop  <= #1 1'b0;
                cmd_stop  <= #1 1'b0;
                dcmd_stop <= #1 1'b0;
 
                al        <= #1 1'b0;
 
            end
 
          else if (rst)
          else if (rst)
            begin
 
                cmd_stop  <= #1 1'b0;
                cmd_stop  <= #1 1'b0;
                dcmd_stop <= #1 1'b0;
          else if (clk_en)
 
            cmd_stop <= #1 cmd == `I2C_CMD_STOP;
 
 
 
        always @(posedge clk or negedge nReset)
 
          if (~nReset)
 
            al <= #1 1'b0;
 
          else if (rst)
                al        <= #1 1'b0;
                al        <= #1 1'b0;
            end
 
          else
          else
            begin
            al <= #1 (sda_chk & ~sSDA & sda_oen) | (sto_condition & ~cmd_stop);
                cmd_stop  <= #1 cmd == `I2C_CMD_STOP;
 
                dcmd_stop <= #1 cmd_stop;
 
                al        <= #1 (sda_chk & ~sSDA & sda_oen) | (sto_condition & ~dcmd_stop);
 
            end
 
 
 
 
 
        // generate dout signal (store SDA on rising edge of SCL)
        // generate dout signal (store SDA on rising edge of SCL)
        always @(posedge clk)
        always @(posedge clk)
          if(sSCL & ~dSCL)
          if(sSCL & ~dSCL)

powered by: WebSVN 2.1.0

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