|  | 
 
| 
我程序设计兼有频率测量和信号控制,使用了两个时钟,一个接晶振,gclk2接频率信号,现在发现gclk2有问题,现象如下:cpld内计数器计数值不对,最后改用一下最简单的程序library ieee;
×
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册  use ieee.std_logic_1164.all;
 use ieee.std_logic_unsigned.all;
 use IEEE.STD_LOGIC_ARITH.ALL;
 entity f724 is
 port(clk: in std_logic;
 f_out: out std_logic;
 countout :buffer std_logic_vector(7 downto 0));
 end;
 architecture structure of f724 is
 begin
 f_out<=clk;
 process(clk)
 begin
 if rising_edge(clk) then
 if countout="11111111" then
 countout<="00000000";
 else
 countout<=countout+'1';
 end if;
 end if;
 end process;
 end structure;
 clk用gclk2接入,除以上三个脚外,gclk1结晶振,用示波器看countout(0)发现是时间间距
 不等的方波,按理说应该是输入频率的2倍频,应时间距相等的方波,输入信号良好,f_out信号良好,如果以上程序将clk用gclk1接入,间距相等,程序仿真结果无误,电路板上gclr,goe闲置,请大家帮忙看看,谢谢
 | 
 |