A
ASIC
Guest
Hello, I'm trying to create an I2C master module in Verilog. I've neve
been able to successfully use inout's in Verilog and I'm still unsure why
I compiled my code and ran a test bench and I noticed the signals were a
least changing; that is, the inout's seemed to be toggling.
After this (although I still don't know if the module is conforming to th
I2C bus protocol: baby steps) I decided to try it on my Altera DE2-11
board using the switches as inputs as I require an active high enable hig
to begin transmission on the bus. When I loaded my code, compiled it again
and installed it on the board I hooked up my logic analyzer and was excite
to see... something: nothing.
I'm confused why nothing at all showed up on my physical device while m
test benches were producing logical values. I'm posting here for any advic
from more experienced people. I've been trying to create this module for
while now and finally started work on it but am sort of at a loss as t
where to begin my trouble shooting since I recently discovered how t
create test benches in the first place; before that I would just load i
onto my hardware lots of times.
These are the only lines that deal with the inout-ness of the pins:
inout sda;
assign sda = (ena_sda)?sda_bit:`HIGH;
assign sdaDataIn = (ena_sda)?`HIGH:sda;
inout scl;
assign scl = (ena_scl)?(pSCL?`HIGH:`LOW):`LOW;
LOW is 0, while HIGH is 1'bZ. pSCL is a clock operating at the frequenc
for I2C transmission. Is this right the use of bidirectional pins or am
way off? If anyone wants more of the code just contact me; I don't want t
flood this post with irrelevant information. It's worth noting that in th
test-bench ena_scl and ena_sda were both working as expected which, i
turn, made sda and scl show up correctly on the simulation.
During my re-reading of this post I realized my physical test pi
assignments had no connection to the I2C bus which meant there was n
resistor to VCC on either of the lines. I fixed that; still have the exac
same output!
Thanks everyone.
---------------------------------------
Posted through http://www.FPGARelated.com
been able to successfully use inout's in Verilog and I'm still unsure why
I compiled my code and ran a test bench and I noticed the signals were a
least changing; that is, the inout's seemed to be toggling.
After this (although I still don't know if the module is conforming to th
I2C bus protocol: baby steps) I decided to try it on my Altera DE2-11
board using the switches as inputs as I require an active high enable hig
to begin transmission on the bus. When I loaded my code, compiled it again
and installed it on the board I hooked up my logic analyzer and was excite
to see... something: nothing.
I'm confused why nothing at all showed up on my physical device while m
test benches were producing logical values. I'm posting here for any advic
from more experienced people. I've been trying to create this module for
while now and finally started work on it but am sort of at a loss as t
where to begin my trouble shooting since I recently discovered how t
create test benches in the first place; before that I would just load i
onto my hardware lots of times.
These are the only lines that deal with the inout-ness of the pins:
inout sda;
assign sda = (ena_sda)?sda_bit:`HIGH;
assign sdaDataIn = (ena_sda)?`HIGH:sda;
inout scl;
assign scl = (ena_scl)?(pSCL?`HIGH:`LOW):`LOW;
LOW is 0, while HIGH is 1'bZ. pSCL is a clock operating at the frequenc
for I2C transmission. Is this right the use of bidirectional pins or am
way off? If anyone wants more of the code just contact me; I don't want t
flood this post with irrelevant information. It's worth noting that in th
test-bench ena_scl and ena_sda were both working as expected which, i
turn, made sda and scl show up correctly on the simulation.
During my re-reading of this post I realized my physical test pi
assignments had no connection to the I2C bus which meant there was n
resistor to VCC on either of the lines. I fixed that; still have the exac
same output!
Thanks everyone.
---------------------------------------
Posted through http://www.FPGARelated.com