Professional Documents
Culture Documents
I2C Project
I2C Project
Assignments
1. Create Verilog Model of I2C circuit Turn in verilog files and screens of simulation 2. Create Schematic of I2C circuit (add verilog models for simulation) Turn in pdfs of schematics Screens of block simulations 3. Create Layout of I2C circuit Turn in pdfs of Layout All are due last day of finals.
However I would suggest this schedule. Verilog Done Sept. 30 Schematic Done After Thanksgiving Break Layout Done right before finals. (That way you can study for your finals)
I2C Protocol
Inter IC bus or I2C bus or I2C bus 2 Wire Bi-directional Bus Utilizes Master and Slave Circuits Developed By Philips Now Owned By NXP
Communication
Control Sequence
Start (S) Data goes low when clock is high Stop (P) Data goes high when clock is high Otherwise data must change when clock is low.
After Every 8 bits the Circut Should Acknowledge the exchange Used to determine if device is on bus.
I2C Pattern
Data is organized with a device address first. The 8th bit of the address data is the R/W(bar) bit. A 1 is a read while a 0 is a write
Start
Data is the clock to the flip flop Clock is the data to the flip flop Asynchronous reset with clock
always @(negedge sda or negedge scl) if (~scl) startbit <= 1'b0; else startbit <= scl;
Shift Register
always @(posedge scl) //can do a parallel load with an "if" statement shiftData <= {shiftData[6:0], sda};
Data Register
Use a case statement to read and write the data register case (dataReg) 3'b0000: //data0 3'b0001: //data1 endcase
Ack Logic
We will not send acks or check acks. However if you implement it you will receive extra credit