Forum Discussion
Altera_Forum
Honored Contributor
10 years agohow to generate a reset signal in Altera Cyclone Ⅳ series?
Verilog:
input reset;
reg counting;
always@(posedge clk or negedge reset)
begin
if(!reset)
counting <= 11'd0;
end reset signal is connect to “M1” pin. is it counting = 0 when FPGA board power on?15 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- All initial states of variables in Altera FPGA devices after power up are set to 'zero' logic. --- Quote End ---
I found that it counting is equal to 1 after power up! why?input reset; reg counting; always@(posedge clk or negedge reset) begin if(!reset) counting <= 11'd1; end - Altera_Forum
Honored Contributor
--- Quote Start --- but my question is Could "M1" pin will generate a falling edge when FPGA board power on? --- Quote End --- All initial states of variables in Altera FPGA devices after power up are set to 'zero' logic. - Altera_Forum
Honored Contributor
--- Quote Start --- Yes, but it will not increase and remains zero permanently. Try this:
--- Quote End --- hello when there is a falling edge of reset signal,counting will equal to 0. but my question is Could "M1" pin will generate a falling edge when FPGA board power on?input reset; reg counting; reg r_reset_n; always@(posedge clk or negedge reset) begin if(!reset) begin counting <= 11'd0; r_reset_n <= 1'b0; end else if (counting <= 11'd1234)// replace 11'd1234 with required reset delay, based on clock frequency, in order to remove glitches. begin counting <= counting + 1'b1; r_reset_n <= 1'b0; end else begin counting <= 11'd2047; r_reset_n <= 1'b1; end end - Altera_Forum
Honored Contributor
hello
when there is a falling edge of reset signal,counting will equal to 0. but my question is Could "M1" pin will generate a falling edge when FPGA board power on? - Altera_Forum
Honored Contributor
Yes, but it will not increase and remains zero permanently.
Try this:input reset; reg counting; reg r_reset_n; always@(posedge clk or negedge reset) begin if(!reset) begin counting <= 11'd0; r_reset_n <= 1'b0; end else if (counting <= 11'd1234)// replace 11'd1234 with required reset delay, based on clock frequency, in order to remove glitches. begin counting <= counting + 1'b1; r_reset_n <= 1'b0; end else begin counting <= 11'd2047; r_reset_n <= 1'b1; end end