新闻中心

EEPW首页 > EDA/PCB > 设计应用 > PWM控制电路基本原理与FPGA

PWM控制电路基本原理与FPGA

作者:时间:2009-05-14来源:网络收藏

  process(clk,reset)

  begin

  if(reset=‘1)then

  Qs=“00000000”;

  elsif clkevent and clk=‘1 then

  Qs=Qs+‘1;

  end if;

  end process;

  reset=‘1 when Qs=255 else

  ‘0;

  caolock=‘1 when Qs=0 else

  ‘0;

  Q=Qs;

  cao=reset or caolock;

  end a_counter;

图中,延迟模块必不可少,其功能是对波形的上升沿进行延时,而不影响下降沿,从而确保桥路同侧不会发生短路.其模块的VHDL程序如下:

  entity delay is

  port(clk: in std_logic;

  input: in std_logic_vector(1 downto 0);

  output:out std_logic_vector(1 downto 0)

  end delay;

  architecture a_delay of delay is

  signal Q1,Q2,Q3,Q4: std_logic;

  begin

  process(clk)

  begin

  if clkevent and clk=‘1 then

  Q3=Q2;

  Q2=Q1;

  Q1=input(1);

  end if;

  end process;

  Q4=not Q3;

  output(1)=input(1)and Q3;

  output(0)=input(0)and Q4;

  end a_delay;

3 结束语
  
采用可编程逻辑器件和硬件描述语言,同时利用其供应商提供的开发工具可大大缩短数字系统的设计时间,节约新产品的开发成本,另外,还具有设计灵活,集成度高,可靠性好,抗干能力强等特点.本文设计的用于某光测设备的传动装置时,取得了良好的效果.

pwm相关文章:pwm原理



上一页 1 2 下一页

关键词: FPGA PWM 控制电路 原理

评论


相关推荐

技术专区

关闭