集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1583|回复: 2

如何产生300hz的三相方波

[复制链接]
AAT 发表于 2010-6-28 00:38:39 | 显示全部楼层 |阅读模式
如何产生300hz的三相方波
HANG 发表于 2010-6-28 01:06:56 | 显示全部楼层
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity test is
port
(
rst:instd_logic;-- 高电平有效
clk:in std_logic;-- 输入时钟1.8KHz
oabc utstd_logic_vector(2 downto 0)-- 从高位到低位分别对应于A、B、C三相输出
);
end test;

architecture bhv of test is

signalcounter:std_logic_vector(2 downto 0);

begin
process(rst,clk)
begin
if rst= '1' then
counter<="000";
elsif clk'event and clk = '1' then
if counter = "101" then
counter<="000";
else
counter<=counter + 1;
end if;
end if;
end process;

process(rst,clk,counter)
begin
if rst = '1' thenoabc<= "101";
else
case counter is
when "000"=>oabc<= "101";
when "001"=>oabc<= "100";
when "010"=>oabc<= "110";
when "011"=>oabc<= "010";
when "100"=>oabc<= "011";
when "101"=>oabc<= "001";
when others=>null;
end case;
end if;
end process;

end bhv;

说明:这里按照输入时钟为1.8KHz设计的,需要用锁相环生成1.8KHz时钟提供给这个模块
FFT 发表于 2010-6-28 02:02:42 | 显示全部楼层
同样期待中!
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|集成电路技术分享 ( 京ICP备20003123号-1 )

GMT+8, 2024-5-15 04:37 , Processed in 0.066880 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表