papry

Why 32MHz XTAL?

Recommended Posts

Last night I ported some VGA type Verilog code from an Altera board to my Papilio One. I needed to generate a 65MHz internal clock, but was surprised at the lack of flexibility of the DCM_SP clock generator. I was able to relatively simply generate 64MHz, which was good enough and my old Dell VGA monitor synced correctly, however some of the clock phase controls needed to be tweaked. It occured to me that it might have been better to use a lower frequency reference crystal, such as 10MHz (or even lower if the DCM allows), as it would give more flexibility. I do of course realise that some frequencies will be impossible whatever the reference XTAL. Purely out of curiosity, I wondered why a frequency of 32MHz was selected?

I also tried out adding a PLL to my blink Papilio Pro project, and found the same issue. 65MHz was not possible (only 64 or 66MHz). I checked the Altera project and the PLL was more flexible in that 65MHz was possible.

I have seen some FPGA dev boards which use a programmable frequency chip, rather than a crystal and I can now see why that might be a really useful feature.

Share this post


Link to post
Share on other sites

The clocking wizard usually does a pretty good job of getting you close to where you need to be. Please look at this tutorial to see how to use the clocking wizard:

http://gadgetfactory.net/learn/2017/02/22/fpga-clocking-clocking-wizard-in-xilinx-ise/

32Mhz was selected because I wanted something below 50Mhz that would be considered low frequency. Also, for the Spartan 3E it had to be over 10Mhz if I remember correctly. I found two reels of 32Mhz oscillators for $10 on eBay and since at the time I was manufacturing all of the Papilio boards on a pick and place in my basement the decision to go with 32Mhz was made easy. :)

Jack.

Share this post


Link to post
Share on other sites

I am sure that there are many cases of people wondering "why did they use that part", and the answer is simply, when they made the design, that part was simply the part that was on hand.

I am pretty familiar with PLLs and the like, and in the case of the DCM_SP with a 32MHz reference, 65MHz is simply not possible. I checked Mouser and replacement xtal osc modules are around £1, so I will likely go this route.

Share this post


Link to post
Share on other sites

Try dual-PLL or dual-DCM. These are values for dual PLL on PPro (Spartan6)

Input clk: 32000000.000000Hz, Output clk 95000000.000000Hz

Best result: 96000000.000000Hz, error is 1000000.000000Hz
        PLL Mult=15, Divide=5

Scanning two-PLL approach

Best result: 95000000.000000Hz, error is 0.000000Hz
        Master PLL: Mult=30, Divide=48 (fout=20000000.000000Hz)
        Slave PLL: Mult=38, Divide=8

 

Share this post


Link to post
Share on other sites

Excellent idea! Like all good ideas they are simple and obvious (in hindsight)!

I need 65MHz, but I can see several ways to get there with 2 DCM_SPs.

Many thanks Alvieboy.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now