Author Topic: How to connect XTAL to FPGA clock?  (Read 3433 times)

0 Members and 1 Guest are viewing this topic.

Offline soFPGTopic starter

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: de
How to connect XTAL to FPGA clock?
« on: May 01, 2021, 06:27:14 pm »
Hello,

sorry for this stupid beginner question but how do I connect an XTAL crystal to an FPGA clock input pin?

I mean - the XTAL has two pins, how am I supposed to connect those?

Best regards
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: How to connect XTAL to FPGA clock?
« Reply #1 on: May 01, 2021, 06:34:11 pm »
You can't connect it directly. You need to build an external oscillator circuit.

But the best way to go is to use CMOS clock generator.

A search term for the distributor sites is "MEMS Oscillator". I personally use DSC61xx series from Microchip. But there is no particular reason for this, they all are basically the same.
« Last Edit: May 01, 2021, 06:37:59 pm by ataradov »
Alex
 
The following users thanked this post: soFPG

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4682
  • Country: dk
Re: How to connect XTAL to FPGA clock?
« Reply #2 on: May 01, 2021, 06:35:56 pm »
you don't, you use an external oscillator
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15244
  • Country: fr
Re: How to connect XTAL to FPGA clock?
« Reply #3 on: May 01, 2021, 07:33:02 pm »
While the usual (and most sensible) approach is to use an external oscillator, for not too high frequencies, and on *some* FPGAs you *may* be able to make an oscillator using 2 *properly* configured IOs (assuming said FPGA has schmitt trigger inputs), one as input and the other as output, implement an inverter between them, and externally route the output to the pin used as clock input. This is not guaranteed to work, but could save a few cents if it does.

Now if you're a beginner, don't even try this.
 
The following users thanked this post: soFPG

Offline dtodorov

  • Contributor
  • Posts: 46
  • Country: bg
Re: How to connect XTAL to FPGA clock?
« Reply #4 on: May 01, 2021, 09:03:15 pm »
While the usual (and most sensible) approach is to use an external oscillator, for not too high frequencies, and on *some* FPGAs you *may* be able to make an oscillator using 2 *properly* configured IOs (assuming said FPGA has schmitt trigger inputs), one as input and the other as output, implement an inverter between them, and externally route the output to the pin used as clock input. This is not guaranteed to work, but could save a few cents if it does.

Now if you're a beginner, don't even try this.

How does such a system boot-up, if this xtal is the only clock source?  :scared:
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: How to connect XTAL to FPGA clock?
« Reply #5 on: May 01, 2021, 09:14:18 pm »
FPGAs don't need external clock to boot up or work. They configure themselves with the internal clock. Often the same clock is accessible to the user logic. Or you can implement your whole project to not need a clock at all. It is all good.
Alex
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15244
  • Country: fr
Re: How to connect XTAL to FPGA clock?
« Reply #6 on: May 01, 2021, 10:27:47 pm »
FPGAs don't need external clock to boot up or work. They configure themselves with the internal clock. Often the same clock is accessible to the user logic. Or you can implement your whole project to not need a clock at all. It is all good.

Yup of course. You can even use an FPGA without any "clock" at all, if all you implement is combinatorial logic.

Conversely, you can have several external clocks. How would the FPGA ever know which one to use if it required an external clock for its configuration?
So yeah, they all have an internal oscillator for this AFAIK. Not always accessible to the user though. Lattice parts, for instance, have internal oscillators that are, but for Xilinx parts, I'm not sure.
 

Offline Shadowfire

  • Contributor
  • Posts: 26
  • Country: us
Re: How to connect XTAL to FPGA clock?
« Reply #7 on: May 02, 2021, 08:03:19 pm »
Yep, they *all* have an internal oscillator for configuration, as was mentioned previously in this thread.
What hasn't been mentioned previously in this thread, is that (if they are available to you) they are NOT very accurate.
Their frequency depends on temperature, voltage, and phase of the moon when they were manufactured.
For instance, some of the MAX10 devices are spec'ed at "55Mhz to 116Mhz" (with this kind of spec its a sure bet that they are RC oscillators, not MEMS or crystal, and also are likely to be internally running at twice this speed and sent through a flipflop to even out the duty cycle).
Some parts allow you to feed this clock into an onboard PLL to change the frequency, some do not.
It's a great way to reduce component count (and thus cost) if your design can deal with the ridiculous frequency variations from part to part.

As for the OP, a crystal is an analog (RLC) device, and does NOT generate a digital clock signal like the FPGA is expecting.  A crystal needs a supplemental inverting amplifier circuit to oscillate, and a signal conditioner to generate a logic-level voltage to drive the FPGA's clock input pin.  You get this in the same package when you buy a device classified as an oscillator.
 

Offline vstrakh

  • Contributor
  • Posts: 23
  • Country: ua
Re: How to connect XTAL to FPGA clock?
« Reply #8 on: May 03, 2021, 11:17:57 am »
on *some* FPGAs you *may* be able to make an oscillator using 2 *properly* configured IOs (assuming said FPGA has schmitt trigger inputs), one as input and the other as output, implement an inverter between them, and

Charles H. Moore went even further with GA144 chip, having ceramic resonator with low Q being driven by software.
One of the chip's nodes had subroutines that attempts to excite the resonator and to monitor the oscillation health using single gpio :)

Quartz resonators with high Q had too much problems with this approach.
 
The following users thanked this post: SiliconWizard

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2794
  • Country: ca
Re: How to connect XTAL to FPGA clock?
« Reply #9 on: May 03, 2021, 01:10:44 pm »
You can technically use built-in config clock in Xilinx 7 series devices too, but since it's horribly inaccurate (±50% frequency tolerance), I can't really see how it can be useful in any practical designs.

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4682
  • Country: dk
Re: How to connect XTAL to FPGA clock?
« Reply #10 on: May 03, 2021, 01:18:12 pm »
You can technically use built-in config clock in Xilinx 7 series devices too, but since it's horribly inaccurate (±50% frequency tolerance), I can't really see how it can be useful in any practical designs.

this might be more accurate,

r-c-r osciallator

http://xilinx.pe.kr/_xilinx/html/tip/sixeasypieces.htm
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2794
  • Country: ca
Re: How to connect XTAL to FPGA clock?
« Reply #11 on: May 03, 2021, 01:22:59 pm »
this might be more accurate,

r-c-r osciallator

http://xilinx.pe.kr/_xilinx/html/tip/sixeasypieces.htm
It's ridiculous. The whole point of the clock in FPGA is to account for time. So it has to be precise enough for application. And besides, MEMS generators are fairly cheap, so no reason to bother with anything else.

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4682
  • Country: dk
Re: How to connect XTAL to FPGA clock?
« Reply #12 on: May 03, 2021, 03:42:24 pm »
this might be more accurate,

r-c-r osciallator

http://xilinx.pe.kr/_xilinx/html/tip/sixeasypieces.htm
It's ridiculous. The whole point of the clock in FPGA is to account for time. So it has to be precise enough for application. And besides, MEMS generators are fairly cheap, so no reason to bother with anything else.

sure in most cases it would be silly to not use a real oscillator, but not all applications need an accurate clock 



 

Offline soFPGTopic starter

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: de
Re: How to connect XTAL to FPGA clock?
« Reply #13 on: May 04, 2021, 08:12:30 am »
And besides, MEMS generators are fairly cheap, so no reason to bother with anything else.

The cheapest one I can find are around 0,80€ / piece. In absolute values its fairly cheap with compared to a crystal it is 10x more expensive
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2794
  • Country: ca
Re: How to connect XTAL to FPGA clock?
« Reply #14 on: May 04, 2021, 01:31:51 pm »
The cheapest one I can find are around 0,80€ / piece. In absolute values its fairly cheap with compared to a crystal it is 10x more expensive
It's also much simpler, and takes less room on a PCB. This kind of penny-pinching is beyond ridiculous. Cheaper is not always better, infact at some point it becomes a serious drag, when saving just a little more introduces serious issues. Also simplicity is a virtue all by itself - the simpler the circuit, the less chance of things going wrong - especially if you need to guarantee operations over wide PVT range.
 
The following users thanked this post: SiliconWizard

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19889
  • Country: gb
  • 0999
Re: How to connect XTAL to FPGA clock?
« Reply #15 on: May 04, 2021, 03:02:38 pm »
Use an IC such as the 74LVC1404, or 74LVC1GX04 to make an oscillator with the crystal.
https://www.ti.com/lit/ds/symlink/sn74lvc1404.pdf
https://assets.nexperia.com/documents/data-sheet/74LVC1GX04.pdf
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11720
  • Country: us
    • Personal site
Re: How to connect XTAL to FPGA clock?
« Reply #16 on: May 04, 2021, 04:05:25 pm »
The cheapest one I can find are around 0,80€ / piece. In absolute values its fairly cheap with compared to a crystal it is 10x more expensive
There are cheaper parts directly from China. I've seen some on LCSC as cheap as 40 cents. But yest that's about the price for them. It is more expensive than the crystal. But in case of the FPGA you have no other options. You can use that inverter gate and implement your own oscillator. But with the cost of the IC and tuning it to start and work reliably, it makes no financial sense.
Alex
 
The following users thanked this post: soFPG


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf