How to drive an externally pulled up with fpga pin?
To drive a line that has an external pull-up from an FPGA, treat the pin as open-drain/open-collector:
-
Never drive a ‘1’.
-
Drive ‘0’ to pull the line low.
-
Otherwise put the pin in Hi-Z so the external resistor pulls it high.
That’s it—plus a few electrical + HDL details below.
HDL patterns
1) Simple open-drain output (Verilog)
2) Bidirectional, e.g., I²C SDA (Verilog)
3) Using vendor I/O buffers
Xilinx (IOBUF):
Intel/Altera (Quartus) assignment (example):
(Or instantiate ALT_IOBUF; behavior is the same—drive 0 or Hi-Z only.)
VHDL idea:
Electrical checklist
-
Pull-up value (speed vs current):
-
Rise time ≈ 0.85 · Rpull · Cbus (RC step).
-
Common choices at 3.3 V: 4.7 kΩ–10 kΩ. Faster edges → 2.2–4.7 kΩ.
-
Sink current when low: I = Vpull / Rpull (e.g., 3.3 V/4.7 kΩ ≈ 0.7 mA).
-
Keep within the FPGA pin’s IOL rating and your VOL target.
-
-
Disable internal pulls/bus-keepers on that pin, or they’ll fight the bus.
-
IO standard & pad settings:
-
Use your bank voltage (e.g., LVCMOS33).
-
SLEW = SLOW and minimal DRIVE (you’re only sinking) to reduce noise.
-
-
5 V pull-ups caution:
-
Multiple drivers (wired-AND):
-
Safe because all drivers only pull low or release.
-
Ensure your logic never asserts two conflicting push-pull drivers—keep everything open-drain style.
-
-
EMI/line integrity:
-
Keep the pull-up physically near the bus, route short, and add small RC if you need edge-rate control on long lines.
-
Quick test pattern (Verilog)
TL;DR
Configure the FPGA pin as open-drain: drive 0 or Z only. Size the pull-up for your rise-time and sink-current budget. Avoid 5 V pull-ups unless the pin is truly 5 V tolerant or you add a level shifter.

评论
发表评论