FPGARelated.com
Forums

Driving crystal with cheap FPGA ( MAchXO2) directly ?

Started by Brane 2 June 16, 2020
On 22/06/2020 16:19:52, Rick C wrote:
> On Monday, June 22, 2020 at 7:01:11 AM UTC-4, Mike Perkins wrote: >> On 16/06/2020 10:20:28, Brane 2 wrote: >>> I tireid using ust a pin pair and inverting function. >>> >>> But with LVCMOS333 on Breakout Board ( 3,3V for I/O), MachXO implements hysteresis on input and this seems to hamper the oscillations. >>> >>> I can't start the crystal reliably. If oscillation starts, it runs fine. >>> >>> I used siimple 24MHz quartz with 1M across and 22pF toward GND on each side. >>> >>> Can't find anythong on the matter on Lattice... >>> >> >> This sounds like a threshold issue. Are you certain the 1M resistor is >> sufficient to always drive the input such that the output should switch >> polarity? >> >> When it doesn't oscillate, is the output always high or low? >> >> What I have seen in similar circumstances, is that the circuit >> oscillates at a frequency governed by the R and C in a relaxation mode, >> and not the crystal at its resonance. > > I believe the resistor is there to establish a DC bias at the threshold of the input. The crystal acts primarily as an LC series resonance, so very low impedance. > > A relaxation oscillator requires a change to the threshold for the two states. You will get that if there is hysteresis. Otherwise not.
The OP mentioned hysteresis on the MaxXO inputs.
> I believe the initial problem was the inclusion of hysteresis in the input pin configuration.
Which, if the 1M resistor is sufficient to establish a DC bias, would have oscillated in one way or another. -- Mike Perkins Video Solutions Ltd www.videosolutions.ltd.uk
tirsdag den 16. juni 2020 kl. 13.57.58 UTC+2 skrev Brane 2:
> I did. 74HC04 plus two small caps and two resistors have done the job for the moment. > > I suppose I could do it on FPGA directly, but it would take some time f**ing around with resitive networks etc.
for a crystal oscillator a 74HCU04 is normally used
On 6/16/20 5:20 AM, Brane 2 wrote:
> I tireid using ust a pin pair and inverting function. > > But with LVCMOS333 on Breakout Board ( 3,3V for I/O), MachXO implements hysteresis on input and this seems to hamper the oscillations. > > I can't start the crystal reliably. If oscillation starts, it runs fine. > > I used siimple 24MHz quartz with 1M across and 22pF toward GND on each side. > > Can't find anythong on the matter on Lattice... >
One comment on this, the basic circuit for a crystal oscilator doesn't need an 'Inverter' from pin to pin, but an inverting amplifier. At the crystal resonate frequency, it provides 180 degrees of phase shift, giving positive gain at that frequency, and oscilation. A typical inverter chip will bias itself into its quasi-linear region and normally oscillate. A generic pair of pins is unlikely to end up biasing itself this way reliably. You are more apt to end up with a relaxation oscillator whose frequency is based on the capacative load and propagation times.
On Sunday, June 28, 2020 at 1:24:03 PM UTC, lasselangwad...@gmail.com wrote:
 
> for a crystal oscillator a 74HCU04 is normally used
True, but I didn't have it at handy, so ordinary HC04 had to do...
On Sunday, June 28, 2020 at 3:19:07 PM UTC-4, Richard Damon wrote:
> On 6/16/20 5:20 AM, Brane 2 wrote: > > I tireid using ust a pin pair and inverting function. > > > > But with LVCMOS333 on Breakout Board ( 3,3V for I/O), MachXO implements hysteresis on input and this seems to hamper the oscillations. > > > > I can't start the crystal reliably. If oscillation starts, it runs fine. > > > > I used siimple 24MHz quartz with 1M across and 22pF toward GND on each side. > > > > Can't find anythong on the matter on Lattice... > > > > One comment on this, the basic circuit for a crystal oscilator doesn't > need an 'Inverter' from pin to pin, but an inverting amplifier. At the > crystal resonate frequency, it provides 180 degrees of phase shift, > giving positive gain at that frequency, and oscilation. > > A typical inverter chip will bias itself into its quasi-linear region > and normally oscillate. > > A generic pair of pins is unlikely to end up biasing itself this way > reliably. You are more apt to end up with a relaxation oscillator whose > frequency is based on the capacative load and propagation times.
I would ask what difference you see between an inverter chip and an inverting function in a more complex device that is relevant in this situation? The point where the bias is important is the input pin. Can you explain what DC level you might expect to see at this input pin that would not be very close to the input threshold voltage? One of these days I should connect an input and output through a resistor to see just what it does with different delays in the path. Then add a few different crystals to see what happens. -- Rick C. -+ Get 1,000 miles of free Supercharging -+ Tesla referral code - https://ts.la/richard11209
One important factor is probably propagation time.

It scerews whole 180=C2=B0 + 180=C2=B0 equation and probably moves the quar=
tz in a suboptimal operating region.
On Monday, June 29, 2020 at 1:50:11 AM UTC-4, Brane 2 wrote:
> One important factor is probably propagation time. > > It scerews whole 180° + 180° equation and probably moves the quartz in a suboptimal operating region.
So a slow inverter (like CMOS) would have the same problem, no? How much delay is acceptable? I don't know any inverters that don't have measurable delay. -- Rick C. +- Get 1,000 miles of free Supercharging +- Tesla referral code - https://ts.la/richard11209
HC,AC have delay that strongly corrsponds to capacitive load.

Fro HC it would be probably about 10 ns worst case and perhaps 3-4 ns when lightly loaded. 

But since here it is oerating practically in linear region, I'd say that with decent VCC (5V) it is closer to 1ns and on 3,3V perhaps 2-3ns...
Also, separate HC doesn't have the problem with current budgets and ground bounce, like FPGA, so that might also be a factor...
On Monday, June 29, 2020 at 7:27:26 AM UTC-4, Brane 2 wrote:
> HC,AC have delay that strongly corrsponds to capacitive load. > > Fro HC it would be probably about 10 ns worst case and perhaps 3-4 ns when lightly loaded. > > But since here it is oerating practically in linear region, I'd say that with decent VCC (5V) it is closer to 1ns and on 3,3V perhaps 2-3ns...
Why would running linear give a 1 ns delay? Even a couple of ns sounds significant when running a 24 MHz crystal. I can get single digit ns delays from pin to pin in an FPGA. TA = +25°C -40°C to +85°C -40°C to +125°C VCC Typ Max Max Max 4.5V — 9 18 23 27 That's a far cry from 1 ns. I'm just not buying the idea that a 74HC04 will be a fine oscillator when a 12 pF load capacitor is used and an FPGA loopback will not. I once designed a circuit where from input to output I had 15 ns. It's still working fine and that was an FPGA available in 2000. -- Rick C. ++ Get 1,000 miles of free Supercharging ++ Tesla referral code - https://ts.la/richard11209