counter question

R

Rafa

Guest
Hello to everyone. I´m new in VHDL and i have (maybe) just a simple
question.
There´s a counter who counts steps from a PLL.
I want to add a special function wich makes the counter add some steps
during a circle
like this:




IF (PLL'event AND PLL = '1') THEN

counter <= counter + 1 + somesteps
END IF;

The problem:

If there is no adjustment, the somestep-Input is 0.
If there are somesteps to add the counter adds the value of
"somesteps" for every PLL-Edge.
But I want to add it only one time.

Has someone an idea?
 
Hi,

maybe you should Reset your counter to this "somesteps"-value
and count up.
It could look like that:

constant somesteps : integer := ... ; -- define constant value
....
process(Reset, PLL_clk)
begin
if Reset='1' then
counter <= somesteps;
elsif (PLL_clk='1' and PLL_clk'event) then
counter <= counter + 1;
end if;
end process;

Kind regards

IF (PLL'event AND PLL = '1') THEN

counter <= counter + 1 + somesteps
END IF;

The problem:

If there is no adjustment, the somestep-Input is 0.
If there are somesteps to add the counter adds the value of
"somesteps" for every PLL-Edge.
But I want to add it only one time.

Has someone an idea?
 

Welcome to EDABoard.com

Sponsor

Back
Top