Forum Discussion
Altera_Forum
Honored Contributor
9 years agoThis works too, I've used it for a long time with Altera Cyclone FPGAs. This code assumes CLOCK_50 is running at 50MHz.
// PowerUP Reset Logic
// generate a 500ms reset pulse on initial powerup
reg pup_count = 25'd0;
reg pup_reset = 1'b1;
always @(posedge CLOCK_50)
begin
pup_count <=# TPD pup_count + 1'd1;
if (pup_count == 25'd25000000) pup_reset <=# TPD 1'b0;
end
wire reset = pup_reset;
Then it gets used like this (where clk is the global PLL generated clock signal, derived from clock_50) as an async reset: always @(posedge clk or posedge reset)
begin
if (reset)
begin
run <= 1'b0;
end
else
begin
run <= mode_normal | mode_emul&stepemul | mode_fast&stepfast | mode_slow&stepslow;
end
end