I am sorry if this problem has been answered but I cannot find much help from the archive.
I am trying to write and read registers from a CMOS sensor via I2C. The SCLK and SDATA pins are pulled by 3.3V and are connected to two I/O pins on Spartan3 FPGA.
When the FPGA is reading from SDATA, would it be always high ('1' bit instead of '0') as it's pulled up??
Thanks!
Nick
Didn't find your answer? Ask the community — no account required.
J
Jonathan Bromley
Yes, provided you do all the right things: (1) Make sure that your FPGA doesn't drive SDATA when disabled. (2) Ensure that there is a pullup resistor of appropriate value somewhere on the SDATA bus.
VHDL: port ... SDATA: inout std_logic; ...
--- Park this signal at '1' when you don't want to drive SDATA. signal internal_SDATA_drive: std_logic;
-- Use this signal as input to your SDATA receiver logic: signal internal_SDATA_rcv: std_logic;
... SDATA
N
Nick
Thanks for your detailed explanation!
I assign the SDATA to 'Z' in order to receive data, but the pin is pulled up so I am wondering if the SDATA will read '1' regardless of the actual incoming value.
Nick
J>
B
backhus
Hi Nick,
Nick schrieb:
The simple answer: No, normally the peripheral that puts a '0' on the SDATA line has a driver that is strong enough to pull the line down.
For further investigation: The voltage on your SDATA line can be modeled as a resistor network (in case of high speed or high accuracy a RLC network). This consists mainly of your pullup resistor and the R(DS) of the CMOS transistors in your connected drivers output stage. With these values you can use the formulas for a simple voltage divider to calculate the voltage on your SDATA line.
e.g. Vcc= 3.3V R(pullup) = 1 KOhm R(DSon)= 50 Ohm
V(SDATA) = 3.3V * 50 Ohm/1050 Ohm = 157 mV
which should be read as a '0' on a digital input.
For the actual values in your design take a look in the datasheets of the devices you use. But the example should give you an idea of what is going on when pullups meet drivers.
Have a nice synthesis
Eilert
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.