Forum Discussion
Altera_Forum
Honored Contributor
10 years agoAltera EP2C5 mini board clock pin
Hi.
I tried the following example (Quartus II 13.0): module ledblink( input clk, output LED ); reg [23:0] cnt; always @(posedge clk) cnt <= cnt + 24'd1; assign LED = cnt[23]; endmodule How can I determine which pin can be used as clk input? Is it possible to check real clk signal with USB Blaster? Thanks3 Replies
- Altera_Forum
Honored Contributor
If you haven't specified a pin for your 'clk' input then Quartus will choose it for you. In Quartus, with your project open, choose 'Assignments' -> ' Pin Planner and look for 'clk' in the left hand column. Then look in the 'Fitter Location' column for the chosen pin. Alternatively look in the .pin file in the project directory.
No, you can't check for a real clock with the USB-Blaster. Cheers, Alex - Altera_Forum
Honored Contributor
--- Quote Start --- If you haven't specified a pin for your 'clk' input then Quartus will choose it for you. In Quartus, with your project open, choose 'Assignments' -> ' Pin Planner and look for 'clk' in the left hand column. Then look in the 'Fitter Location' column for the chosen pin. Alternatively look in the .pin file in the project directory. No, you can't check for a real clock with the USB-Blaster. Cheers, Alex --- Quote End --- Thank you for the answer. I am already accustomed with pin assignment. But how can I know that the pin is exactly in clock mode? I chose intuitively. I opened Pin Planner and assigned to clk the pin with one of the functions as "dedicated clock" (Pin_17), while the same pin maybe an input pin... I found 4 pins on the left side of the chip and 4 on the right side with first function as "dedicated clock". How can I see that they are in clock mode and not in an input mode? - Altera_Forum
Honored Contributor
Quartus will work out from your code what signals are clocks and what signals are not clocks. It is good practice to connect your 'clk' signal to a dedicated clock input pin.
A dedicated clock input pin can also be used as a general purpose input pin, for an input signal that is not a clock. That is all that the pin listing is telling you. So, if you were to add an input signal to your example as follows:
The input signal 'stop' could connect up to another 'dedicated clock/input' pin or any other user I/O pin. Cheers, Alexmodule ledblink( input wire clk, input wire stop, output wire LED ); reg cnt; always @(posedge clk) if (!stop) cnt <= cnt + 24'd1; assign LED = cnt; endmodule