exgreyfox2
Newbie level 5
- Joined
- Mar 22, 2012
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,334
Hello,
I want to my an LED pulse on for 1 second and off for 1 second with Digilent BASYS board using the 25MHz clock. Here is my code but it does not seem to output anything to the LED. The idea is to count however many cycles of the 25MHz clock it takes to make 1 second and then reset the counter and toggle the LED on. q_out controls the LED.
Thank you for any help.
I want to my an LED pulse on for 1 second and off for 1 second with Digilent BASYS board using the 25MHz clock. Here is my code but it does not seem to output anything to the LED. The idea is to count however many cycles of the 25MHz clock it takes to make 1 second and then reset the counter and toggle the LED on. q_out controls the LED.
Code:
module Seconds_Clock(clk, count, q_out);
input clk;
output count;
output q_out;
reg [24:0] count;
reg q_out;
always@(posedge clk)
begin
if (count == 25000000)
begin
q_out <= 1'b1;
count <= 1'b0;
end
else
begin
q_out <= 1'b0;
count <= count + 1;
end
end
endmodule
Thank you for any help.