mrflibble
Advanced Member level 5
I'm transmitting data to FPGA by writing it on 'transmit register' using PIC programming in 8051, so i am confused what is input for sda_pad_i?
Your top level module should look something like:
Code:
top_level_module (
// other stuff
inout wire scl,
inout wire sda,
// still more stuff
);
Then you connect the signals from the i2c module something like:
Code:
wire scl_pad_o;
wire sda_pad_o;
assign scl = (scl_pad_o == 1'b0) ? (1'b0) : (1'bz);
assign sda = (sda_pad_o == 1'b0) ? (1'b0) : (1'bz);
i2c_core_module_name example_instance (
.scl_pad_o(scl_pad_o),
.sda_pad_o(sda_pad_o),
.sda_pad_i(sda),
// etc
);
This will synthesize to open-collector outputs.
For simulation, you'll have to add a couple of pullups to the sda and scl lines. If you don't then the high signal levels will show as Z's in the simulation.