⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 overcur_ctrl.vhd

📁 在quartus开发环境下
💻 VHD
字号:
--过流保护程序
--电路将反馈电流转换为[-5--+5]范
--通过减法电路将之转换为[0--10]
--最后,通过分压电路将之转换为[0--5]
--作为ADC0809的输入信号
--中点为2.5v

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity overcur_ctrl is
 port(c0809in:in std_logic_vector(7 downto 0);
      posin :in std_logic_vector(7 downto 0); 
      en:out std_logic;
      ctrl_out:out std_logic_vector(7 downto 0));
end entity;

architecture one of overcur_ctrl is
 begin
   process(c0809in,posin)
    begin
        if c0809in>="01001101"  and c0809in<="10110100"then   --77~180 
              ctrl_out<=posin;en<='1';     --en为PWM波使能信号
        else  en<='1'; ctrl_out<=posin-"00101111";
        end if;
   end process;
end one;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -