Forum Discussion
Altera_Forum
Honored Contributor
11 years agoThanks for reply. My task is to connect a button to fpga port, configure one pin as GND, other as pull up, and drive a LED depending on button state. I attached picture illustrating it.
Problems is that I don't know how to correctly assign pull up. I tried using tri1 with directions: output - measured 3.333V. LED all time off. input - measured 3V. When button not pressed - LED off, when pressed On. inout - measured ~200mV. When button not pressed - LED off, when pressed On. It works, but even if I touch the pins metal with finger, the LED turns on. At last I got It woking as input. Iam using Aldec- HDL, in block diagram I changed pin direction in module and terminal direction equally. module link_klavos2 (q, c, r ); output wire q; inout tri1 c; output reg r; initial begin r = 0; end assign q = ~c; endmodule