quartus II FPGA 引脚电平设置

17 篇文章 6 订阅

目录

一、未使用的PIN设置

1. 当所有的未使用的PIN设置为输出接地时:

2. 当所有的未使用的PIN设置为三态输入:

 3.设置为若上拉或者三态时

二、I/Obank电压


一、未使用的PIN设置

1. 当所有的未使用的PIN设置为输出接地时:

主要指:所有的IC PIN,包括已经定义了输入或者输出的PIN,但是没有实际的信号进出(即未使用),测试为0v。

反面讲,使用的PIN,是指实际定义并在逻辑里使用这个信号,且有实际负载的才算。否则就算定义了,如果没有实际使用也是未使用。

2. 当所有的未使用的PIN设置为三态输入:

 3.设置为若上拉或者三态时

如果在PIN PLANNER中定义了输入弱上拉,那么未使用时测试为高电平。其余PIN受set the unused pins as "inputs tri-stated with weak pull up",控制,为低电平。

        测得的高电平电压与I/O bank standard设置电压的关系如下:

       外部硬件将Bank接到3.3v, 

        1) 对于输入PIN,无负载时来说:如果设置了若上拉,那么I/O bank 电压为3.3v,2.5v或者1.8v时均测得 2.0v;如果没有若上拉,那么均测得0v;

        2)  对于输出PIN,若上拉没有关系;I/O bank设置为3.3v, 2.5v,1.8v时测得输出高电平电压为均为3.3V;

        3)如果是没有定义的pin,测得的电压为外部bank的供电电压。

        因此,I/O bank 电压标准只是用于FPGA判断输入或者输出的电平为高或者低,二实际PIN脚的电压只与硬件供电电压有关。

4. 一般情况下设置为三态输入或者三态弱上拉输入。同时硬件需要外部处理如下:

If you set the unused pins as "inputs tri-stated" in the Quartus® II software, you should connect the pins on the PCB to VCCIO, GND, or a static signal for better noise immunity.

If you set the unused pins as "inputs tri-stated with weak pull up", you do not have to connect the pin on the board. The internal pull up to VCCIO will bias the pin and prevent it from floating.

如果不设置,可能发生情况:

If your dedicated input or IO pins are left floating, then the input transistors might fall outside of the saturation or cut-off region. As a result, the device could draw additional current and increase the device's power consumption.
Additionally, if left floating, these pins are apt to switch (they behave similar to antennas) which can inject noise into the device.

As such, Altera recommends connecting these dedicated pins to the appropriate logic level defined by the Altera® software pin file (typically either VCC or GND).

二、I/Obank电压

         FPGA逻辑电平只有3.3V,2.5V,1.8V只用于差分信号使用。

        如果硬件设置了bank电压为2.5v,那么作为输出时这个bank只能驱动2.5v的外设,作为输入可以接收2.5/3.3v的电压。

        另外不同bank可以支持不同的i/o标准,但是同一bank的电压最好是同一标准。

      

  • 6
    点赞
  • 34
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
好的,下面是一个简单的电子密码锁的VHDL代码实现,在Quartus中可以进行仿真和综合。 ```vhdl library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity password_lock is port( clk: in std_logic; reset: in std_logic; input: in std_logic_vector(3 downto 0); output: out std_logic ); end entity password_lock; architecture behavioral of password_lock is constant password: std_logic_vector(3 downto 0) := "1010"; signal password_index: integer := 0; signal is_open: boolean := false; begin process(clk, reset) begin if reset = '1' then password_index <= 0; is_open <= false; output <= '0'; elsif rising_edge(clk) then if input = password(password_index) then password_index <= password_index + 1; if password_index = 4 then is_open <= true; password_index <= 0; end if; else password_index <= 0; end if; if is_open then output <= '1'; else output <= '0'; end if; end if; end process; end architecture behavioral; ``` 以上代码实现了一个4位密码锁,正确输入密码后输出为高电平,否则输出为低电平。其中,clk为时钟信号,reset为复位信号,input为输入的4位密码,output为输出的信号。密码为常量,存储在password变量中。在process过程中,使用password_index变量记录输入密码的位置,使用is_open变量记录是否输入正确密码并开锁的状态。在适当的时候,将password_index清零,以便下次输入时重新开始。最后,根据is_open的状态输出相应的信号

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值