Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

a basic timer in VHDL

Altera_Forum
Honored Contributor II
2,228 Views

hi, how can I write a program for a timer which counts up to 6.4 micro seconds? 

thanks in advance
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
1,379 Views

entity timer is end entity timer; architecture time of timer is signal timer : std_logic; begin timer <= '0', '1' after 6.4 us; end architecture time;

0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

Use a template from Quartus 

 

Create a new vhdl file. 

 

Select edit menu->insert template-> 

 

Select VHDL->Full Designs->Counters->Binary Count 

 

Then modify then MAX_COUNT value depending on your input clock speed. i.e. how many input clock periods in 6.4us 

 

Templates are agood way of finding out how to code various constructs 

 

Hope this helps
0 Kudos
Altera_Forum
Honored Contributor II
1,379 Views

Tricky gave a solution which is NOT synthesizable. Good for simulation only. 

 

I am agree with Vernmid
0 Kudos
Reply