Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21611 Discussions

a basic timer in VHDL

Altera_Forum
Honored Contributor II
2,217 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,368 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,368 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,368 Views

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

 

I am agree with Vernmid
0 Kudos
Reply