Author Topic: Driving another IC from the XTAL out of a micro  (Read 10042 times)

0 Members and 1 Guest are viewing this topic.

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1185
  • Country: gb
Driving another IC from the XTAL out of a micro
« on: January 02, 2021, 07:55:13 am »
Hi,
I need to drive this IC from a single clock source to keep cost as low as possible: https://www.analog.com/media/en/technical-documentation/data-sheets/AD9833.pdf

Because I have a micro in the system, can I use the XTAL out (any microchip micros) directly driving the AD9833?

If not I assume that putting a digital gate (inverting or non inverting digital buffer) would work?

Thank you :)
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: Driving another IC from the XTAL out of a micro
« Reply #1 on: January 02, 2021, 08:27:54 am »
No, the Xout directly will not work. But out of "any microchip micros" some have ability to output a clock on the pin.

The buffer may also not work, the signal level on the Xout pin will probably be too low, and the buffer input may create too much load.

This IC needs 25 MHz, which is also an unusually high to a typical MCU crystal.

Your best bet is to use clock output on a pin (if available on the selected MCU), or use a timer to generate the clock.

Details would depend on what specific micro you are using.

Another option is to use a CMOS clock generator and feed it into both devices. It would be more expensive than a plain crystal, but will probably be on par with a crystal and a buffer.
Alex
 
The following users thanked this post: LexLabs

Offline ace1903

  • Regular Contributor
  • *
  • Posts: 243
  • Country: mk
Re: Driving another IC from the XTAL out of a micro
« Reply #2 on: January 02, 2021, 06:26:04 pm »
I used a similar feature on STM micro. There is an option to put on a specific pin(MCO) system clock divided with a selectable divider.
Use standard crystal something like 8MHz, with internal PLL multiply it to 50 and divide it to get 25MHz.
Some of the microchip micro have an option to output Fosc/4 on some PortA pin.
Some advanced series (maybe PIC18F26k80) think that have a similar option as MCO from STM but I never used it personally.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2838
  • Country: us
Re: Driving another IC from the XTAL out of a micro
« Reply #3 on: January 02, 2021, 09:30:34 pm »
I built a Function Generator with an AD9834 and a PIC18F2550 MCU.
I used a clock module to drive both instead of a crystal.

https://www.digikey.com/en/products/detail/abracon-llc/ACH-48-000MHZ-EK/675376?s=N4IgTCBcDaIKwGY4FoCcBGAHO5KByAIiALoC%2BQA

You may want to divide the output for the AD9833 because of its low max clock frequency.
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17779
  • Country: us
  • DavidH
Re: Driving another IC from the XTAL out of a micro
« Reply #4 on: January 02, 2021, 11:32:47 pm »
I have used the crystal output pin to drive other loads before but from what ataradov says, this may depend on how the oscillator is implemented.
 

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1960
  • Country: us
Re: Driving another IC from the XTAL out of a micro
« Reply #5 on: January 03, 2021, 08:38:56 am »
My latest version of doing exactly this is on a PIC18F26K80. I'm using one of the CCP modules in PWM mode to generate a 50% duty cycle 4MHz clock for a standalone CAN controller chip because this board needs two CAN interfaces. So it is easily doable for zero incremental cost.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13378
Re: Driving another IC from the XTAL out of a micro
« Reply #6 on: January 03, 2021, 08:55:51 am »
It should be possible to buffer the signal on the driven side of the crystal to extract a usable clock.  If you use a 74LVC2GU04 with a capacitively coupled input and a high value feedback resistor round the first inverter with the second open loop to square it up it should work satisfactorily.  I have used a similar circuit with a 74ACU04 to regenerate a TTL level clock from a 0.7V 'base drive' clock source. 
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20841
  • Country: gb
  • 0999
Re: Driving another IC from the XTAL out of a micro
« Reply #7 on: January 03, 2021, 05:49:37 pm »
Why not use the 74LVC1GX04 to make the crystal oscillator? It will do a better job of both driving the MCU's clock input and the AD9833.
https://www.ti.com/lit/ds/symlink/sn74lvc1gx04-ep.pdf
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13378
Re: Driving another IC from the XTAL out of a micro
« Reply #8 on: January 03, 2021, 07:00:40 pm »
That's an even better choice for buffering the PIC's own crystal oscillator, as well as for building an independent Pierce oscillator.  The problem with an independent oscillator is the need to shut it down if you are making use of the PIC's low energy sleep/standby modes, however as the AD9833 draws typ. 0.5mA in its sleep mode (with MCLK running - no figure is
 given for MCLK stopped), it may well be worth using an I/O to drive a P-MOSFET to gate power to both the AD9833 and the Pierce oscillator.
« Last Edit: January 04, 2021, 11:05:05 pm by Ian.M »
 

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1185
  • Country: gb
Re: Driving another IC from the XTAL out of a micro
« Reply #9 on: January 04, 2021, 10:27:17 pm »
Thank you all for the feedback and suggestions, Much appreciated as usual!! :)
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Driving another IC from the XTAL out of a micro
« Reply #10 on: January 05, 2021, 01:02:26 am »
There are generally two kinds of internal oscillators: those with current-limited or analog drive, or a schmitt trigger with full CMOS output level.  The former just need two capacitors and a crystal (or other resonant network), the latter typically uses the same network plus a series resistor (1.5kohms being typical) to limit crystal power and set network impedance.

The latter type you could wire to other things; the former, nah.

Fortunately, a lot of MCUs also have clock output pins, either directly (from the clock tree) or via timer (set one to a trivial 0 or 1 or 2 count or whatever, and enable the timer output).  If you need it to be in a particular phase, and no frequency division or anything, you might need to use an external clock generator.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1185
  • Country: gb
Re: Driving another IC from the XTAL out of a micro
« Reply #11 on: January 05, 2021, 02:58:48 am »
Thank you Tim :)
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20841
  • Country: gb
  • 0999
Re: Driving another IC from the XTAL out of a micro
« Reply #12 on: January 05, 2021, 09:34:58 am »
That's an even better choice for buffering the PIC's own crystal oscillator, as well as for building an independent Pierce oscillator.  The problem with an independent oscillator is the need to shut it down if you are making use of the PIC's low energy sleep/standby modes, however as the AD9833 draws typ. 0.5mA in its sleep mode (with MCLK running - no figure is
 given for MCLK stopped), it may well be worth using an I/O to drive a P-MOSFET to gate power to both the AD9833 and the Pierce oscillator.
There's the 74LVC1404, which has a shutdown pin, but it needs to be activated, without the MCU.
https://www.ti.com/lit/ds/symlink/sn74lvc1404.pdf
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13378
Re: Driving another IC from the XTAL out of a micro
« Reply #13 on: January 05, 2021, 10:04:19 am »
There's the 74LVC1404, which has a shutdown pin, but it needs to be activated, without the MCU.
https://www.ti.com/lit/ds/symlink/sn74lvc1404.pdf
Many PICs support  fallover to an internal oscillator if the external clock source fails, or one can switch clock sources before hand, so its no particular problem to disable the external oscillator before entering whatever sleep mode is appropriate, then on wakeup, re-enable it and wait for the flag bit that indicates a stable external clock source is present.
 

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1185
  • Country: gb
Re: Driving another IC from the XTAL out of a micro
« Reply #14 on: January 05, 2021, 02:59:20 pm »
Thank you Ian and Zero999 :)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2838
  • Country: us
Re: Driving another IC from the XTAL out of a micro
« Reply #15 on: January 05, 2021, 10:24:22 pm »
Before you go too far down the rabbit hole...

Checkout the AD9834:
 - Higher max clock (i.e. higher output frequencies)
 - Amplitude control (see attachment)
 

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1185
  • Country: gb
Re: Driving another IC from the XTAL out of a micro
« Reply #16 on: January 06, 2021, 02:38:43 pm »
Thank you Mark, :)
that is a very interesting part but very expensive. My goal was to remove one oscillator to lower the manufacturing cost by those few pennies.

Thank you
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2135
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Driving another IC from the XTAL out of a micro
« Reply #17 on: January 06, 2021, 02:57:50 pm »
No, the Xout directly will not work. But out of "any microchip micros" some have ability to output a clock on the pin.
Driven DAC's, ADC's, CPLD's and other types of IC's (up to 3 other devices) with the XOUT (crystals upto 27MHz) dsPIC's and PIC's for many years. We tend to connect XOUT to the XIN of the part via a small capacitor (22pF) or sometimes via resistors (510R). You can do this as most XIN circuits are fairly high-Z.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2838
  • Country: us
Re: Driving another IC from the XTAL out of a micro
« Reply #18 on: January 06, 2021, 03:59:54 pm »
Thank you Mark, :)
that is a very interesting part but very expensive. My goal was to remove one oscillator to lower the manufacturing cost by those few pennies.

Thank you

Expensive yes. However, it's $11 USD vs $10 USD for the AD9833.
Not much difference in cost for twice the capability.     :-//

https://www.mouser.com/ProductDetail/Analog-Devices/AD9833BRMZ/?qs=BpaRKvA4VqFt3Bdw9RBKCQ%3D%3D

https://www.mouser.com/ProductDetail/Analog-Devices/AD9834BRUZ/?qs=BpaRKvA4VqHBu5%252BTE5Ntxw%3D%3D
« Last Edit: January 06, 2021, 04:03:37 pm by MarkF »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16289
  • Country: fr
Re: Driving another IC from the XTAL out of a micro
« Reply #19 on: January 06, 2021, 04:27:32 pm »
No, the Xout directly will not work. But out of "any microchip micros" some have ability to output a clock on the pin.
The buffer may also not work, the signal level on the Xout pin will probably be too low, and the buffer input may create too much load.

Yeah. I guess the right answer is that "it depends". Largely depends on the internal oscillator, often just around an inverter, so depends on its max source and sink output current.

On some MCUs, that will work. But even if it does, I would certainly double check the datasheets to see if I'm not running too close to a corner case.
Also, even if it "works", you'll load this one side of the resonant circuit with a capacitance (input capacitance of whatever clock input you're using), and this capacitance is likely close to the typical value of the caps to ground on each side of the crystal. So this will slightly shift the frequency. Whether it matters or not is up to you to figure out. You can also compensate using a smaller value cap, or no cap at all, on this one side.

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: Driving another IC from the XTAL out of a micro
« Reply #20 on: January 06, 2021, 05:09:01 pm »
Driven DAC's, ADC's, CPLD's and other types of IC's (up to 3 other devices) with the XOUT (crystals upto 27MHz) dsPIC's and PIC's for many years. We tend to connect XOUT to the XIN of the part via a small capacitor (22pF) or sometimes via resistors (510R). You can do this as most XIN circuits are fairly high-Z.

The device requires a full CMOS clock input, it has no typical crystal oscillator input. V_INH is 1.7 V. There is no way to drive that with a typical Xout of the MCU without buffering.
Alex
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2135
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Driving another IC from the XTAL out of a micro
« Reply #21 on: January 06, 2021, 06:58:57 pm »
Driven DAC's, ADC's, CPLD's and other types of IC's (up to 3 other devices) with the XOUT (crystals upto 27MHz) dsPIC's and PIC's for many years. We tend to connect XOUT to the XIN of the part via a small capacitor (22pF) or sometimes via resistors (510R). You can do this as most XIN circuits are fairly high-Z.
The device requires a full CMOS clock input, it has no typical crystal oscillator input. V_INH is 1.7 V. There is no way to drive that with a typical Xout of the MCU without buffering.
Beg to differ. The figures in the datasheet are the guarantees for the minimum value the part will switch at. So if we assume say a 3.3V supply, then the datasheet guarantees it will switch if your CLK>2.0V and CLK<0.7V, which is only a 1.4V swing.

I've just made some measurements on one our products that consists of a dsPIC33FJ XOUT driving two 24b ADC's - clock is hitting 52% duty cycle at 12.288MHz (ordinary cheap HC49/4H packaged crystal) on XOUT, output is 3.2Vp-p

Even so, it's quite possible to use a potential divider to bias the CLK of the AD9833 and then capacitively couple in XOUT from a PIC. Might require a bit of experimentation, but certainly worth an hour to try.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: Driving another IC from the XTAL out of a micro
« Reply #22 on: January 06, 2021, 07:32:59 pm »
Ok, I'm not sure how dsPICs drive their crystal. On ARM MCUs Xout is 0.3 V amplitude centered around 0.6 V with automatic gain control enabled. With AGC disabled, the amplitude is a bit higher, but it still lower than 1 V. So clearly "(any microchip micros)" makes a difference here. Not all of them are the same.

I'm also not sure how oscillations on XOUT can have this high of an amplitude when oscillator is working. Won't that overdrive the crystal?
« Last Edit: January 06, 2021, 07:36:41 pm by ataradov »
Alex
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13378
Re: Driving another IC from the XTAL out of a micro
« Reply #23 on: January 06, 2021, 07:57:18 pm »
Many PICs can be configured (during programming) for various crystal oscillator drive levels, and Microchip advise different settings depending on the crystal frequency.  Just don't select the high output setting if you are going to connect a ultra-low-power watch crystal!
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2135
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Driving another IC from the XTAL out of a micro
« Reply #24 on: January 07, 2021, 12:34:23 am »
If you are using a watch crystal, then typically you use the secondary oscillator (SOSC) on a PIC/dsPIC, this is optimised for lower power.  Some of the early PIC's recommended series resistors for the OSC.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2838
  • Country: us
Re: Driving another IC from the XTAL out of a micro
« Reply #25 on: January 07, 2021, 04:02:37 am »
It might be helpful to know which PIC the OP is planning to use.

I used a PIC18F2550 with the AD9834.
And used 99% of the program memory (150 bytes free).
It has sine, triangle, square, sine sweep up/down, triangle sweep up/down, and PWM waveforms.

If I had it to do over, I'd use a PIC18F2620 with twice the program memory.
Just because I'm using it in another project.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf