⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 i2c8_sample.v

📁 I2c 总线测试程序,经过多次验证的.包括读写模式(第一次上传)
💻 V
字号:
  wire SCL8_IN ;  wire SDA8_IN ;  wire SDA8_OUT;    wire SCL8,SDA8;  assign SCL8_IN = SCL8;  assign SDA8_IN = SDA8;  assign SDA8 = (SDA8_OUT==1'b0)? 1'b0:1'bz;    assign (pull1,pull0) SCL8 = 1'b1;  assign (pull1,pull0) SDA8 = 1'b1;    reg SCL8_M,SDA8_M;  reg [7:0] wdat8_tmp,rdat8_tmp,wdat8,rdat8;  reg ack8;  integer i8;    initial  begin    wdat8_tmp = 8'hzz;    rdat8_tmp = 8'h00;    wdat8 = 8'h00;    rdat8 = 8'h00;    ack8 = 1'b0;    SDA8_M = 1'bz;    SCL8_M = 1'bz;        # 10000;    //-------------------------------------        `include "./tb/i2c8/i2c8_start.v"        wdat8 = 8'h00;    `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h00;    `include "./tb/i2c8/i2c8_write_byte.v"        wdat8 = 8'h11; `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h22; `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h33; `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h44; `include "./tb/i2c8/i2c8_write_byte.v"        `include "./tb/i2c8/i2c8_stop.v"        //-------------------------------------        `include "./tb/i2c8/i2c8_start.v"        wdat8 = 8'h00;    `include "./tb/i2c8/i2c8_write_byte.v"    wdat8 = 8'h00;    `include "./tb/i2c8/i2c8_write_byte.v"        `include "./tb/i2c8/i2c8_stop.v"        `include "./tb/i2c8/i2c8_start.v"        wdat8 = 8'h01;    `include "./tb/i2c8/i2c8_write_byte.v"        repeat(3)    begin      `include "./tb/i2c8/i2c8_read_byte.v"    end        `include "./tb/i2c8/i2c8_read_last.v"        `include "./tb/i2c8/i2c8_stop.v"    //-------------------------------------        # 10000; $finish;  end    assign (strong1,strong0) SCL8 = SCL8_M;  assign (strong1,strong0) SDA8 = SDA8_M;    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -