Forum Discussion
Altera_Forum
Honored Contributor
12 years agoIn my trigger condition selection, I just have the options basic and advanced. When advanced is selected, It opens up a new window where components can be placed etc. which I don't think is necessary. What are you using for your serial configuration clock on the right hand side of set-up? On mine I am using clock_50 which corresponds to the 50MHz clock on my board. I am not sure if this is correct.
I have even created simple frequency divider VHDL code and I still can't get this to work. I have a counter counting up to 50 and then back to 0. I wish to capture just 0 to 10 of this counter. When I press the trigger, which is a negative edge on the push button, it states that it is acquiring post-trigger data and just does nothing. Here is my code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
use ieee.numeric_std.all;
------------------------------------------------------------------
ENTITY freq_divider IS
PORT ( clock_50 : IN STD_LOGIC;
button : IN STD_LOGIC;
clk : OUT STD_LOGIC
);
END freq_divider;
------------------------------------------------------------------
ARCHITECTURE behaviour OF freq_divider IS
SIGNAL count1 : INTEGER:= 0;
SIGNAL count2 : INTEGER:= 0;
SIGNAL counter : INTEGER:= 0;
--SIGNAL bufclk : STD_LOGIC;
SIGNAL freq1 : STD_LOGIC;
SIGNAL freq2 : STD_LOGIC;
SIGNAL freq3 : STD_LOGIC;
SIGNAL freq4 : STD_LOGIC;
BEGIN
--bufclk<= clock_50;
PROCESS (clock_50)
VARIABLE GO : STD_LOGIC:= '0';
BEGIN
IF (button = '0') THEN
GO := '1';
END IF;
IF (clock_50'EVENT AND clock_50 = '1' ) THEN
count1 <= count1 + 1;
IF (count1 >= 200) THEN
count1<= 0;
counter<= counter +1;
IF (counter = 50) THEN
counter<= 0;
END IF;
freq1<= NOT(freq1);
END IF;
END IF;
END PROCESS;
PROCESS (freq1)
BEGIN
IF (freq1'EVENT AND freq1 = '1') THEN
count2 <= count2 + 1;
IF (count2 >= 50) THEN
count2<= 0;
freq2<= NOT(freq2);
clk<=freq2;
END IF;
END IF;
END PROCESS;
END behaviour;
---------------------------------------------------------------------------------------------