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.

clock generator

Altera_Forum
Honored Contributor II
2,442 Views

Thank you, how i do? this is a way to learn . I have a project or I do PRODUCING A synchronous clock generator using Altera CPLD max3, ie from an input clock I must have output frequencies 8kHz output and 256 kHz and I think I can utiliset altpll of Quartus (megawizard) but I also need the VHDL code and testbench to simulate in ModelSim-Altera.  

in fact it was what I do.thanks
0 Kudos
10 Replies
Altera_Forum
Honored Contributor II
1,188 Views

May I recall my first answer to the first of your serial posts: 

 

--- Quote Start ---  

FPGA PLLs can't generate that low frequencies, check the respective device handbooks for the available PLL frequency range. Also CPLDs have no PLL hardware. 

 

A clock divider is the usual solution for low frequencies. 

--- Quote End ---  

 

 

As you clearly mentioned MAX CPLD now, we can stop the PLL and altpll Megawizard discussion. The clock generator problem reduces to calculate n in clkoutfreq = clkinfreq / n and build a synchronous counter. The required waveform depends on the intended purpose of your output clocks, they can be e.g. 50% duty cycle or one input clock cycle duration. The latter would be meaningful in a synchronous design, that uses the divided clocks as a clock enable. But you didn't tell and we can't know.
0 Kudos
Altera_Forum
Honored Contributor II
1,188 Views

thank you but I want to know by what method it can be done

0 Kudos
Altera_Forum
Honored Contributor II
1,188 Views

Use a counter controlled by a global (fast) clock. Compare to specific values to obtain the desired output clock frequency, and swith the low clock when this value is reached. Reset the counter at the same time and start the process again.

0 Kudos
Altera_Forum
Honored Contributor II
1,188 Views

agree thank you but I want to use a circuit that already exists on the Quartus software and I get code for vhdl simulation in ModelSim Altera

0 Kudos
Altera_Forum
Honored Contributor II
1,188 Views

I don't think that such a component exists in Quartus but it's very straightforward to write in VHDL.

0 Kudos
Altera_Forum
Honored Contributor II
1,188 Views

yes I think with a PLL, using the tools altpll

0 Kudos
Altera_Forum
Honored Contributor II
1,188 Views

The Max CPLDs don't have PLLs.

0 Kudos
Altera_Forum
Honored Contributor II
1,188 Views

Exactly. Cause I already mentioned it twice, I'm tired of the discussion now.

0 Kudos
Altera_Forum
Honored Contributor II
1,188 Views

but how we can solve this problem

0 Kudos
Altera_Forum
Honored Contributor II
1,188 Views

Using a counter, as suggested above.

0 Kudos
Reply