?? overcur_ctrl.vhd
字號(hào):
--過(guò)流保護(hù)程序
--電路將反饋電流轉(zhuǎn)換為[-5--+5]范
--通過(guò)減法電路將之轉(zhuǎn)換為[0--10]
--最后,通過(guò)分壓電路將之轉(zhuǎn)換為[0--5]
--作為ADC0809的輸入信號(hào)
--中點(diǎn)為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波使能信號(hào)
else en<='1'; ctrl_out<=posin-"00101111";
end if;
end process;
end one;
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -