Driving another IC from the XTAL out of a micro - Page 1
Forum section: electronics / projects

author: ricko_uk
author_rank: Super Contributor
timestamp: January 02, 2021, 07:55:13 am
content: 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.pdfBecause 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

author: ataradov
author_rank: Super Contributor
timestamp: January 02, 2021, 08:27:54 am
content: 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.

author: ace1903
author_rank: Regular Contributor
timestamp: January 02, 2021, 06:26:04 pm
content: 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.

author: MarkF
author_rank: Super Contributor
timestamp: January 02, 2021, 09:30:34 pm
content: 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%2BQAYou may want to divide the output for the AD9833 because of its low max clock frequency.

author: David Hess
author_rank: Super Contributor
timestamp: January 02, 2021, 11:32:47 pm
content: 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.

author: IDEngineer
author_rank: Super Contributor
timestamp: January 03, 2021, 08:38:56 am
content: 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.

author: Ian.M
author_rank: Super Contributor
timestamp: January 03, 2021, 08:55:51 am
content: It should be possible to buffer the signal on the driven side of the crystal to extract a usable clock. If you use a74LVC2GU04with 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.

author: Zero999
author_rank: Super Contributor
timestamp: January 03, 2021, 05:49:37 pm
content: 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

author: Ian.M
author_rank: Super Contributor
timestamp: January 03, 2021, 07:00:40 pm
content: 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 isgiven 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.

author: ricko_uk
author_rank: Super Contributor
timestamp: January 04, 2021, 10:27:17 pm
content: Thank you all for the feedback and suggestions, Much appreciated as usual!!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 05, 2021, 01:02:26 am
content: 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

author: ricko_uk
author_rank: Super Contributor
timestamp: January 05, 2021, 02:58:48 am
content: Thank you Tim

author: Zero999
author_rank: Super Contributor
timestamp: January 05, 2021, 09:34:58 am
content: Quote from: Ian.M on January 03, 2021, 07:00:40 pmThere'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

author: Ian.M
author_rank: Super Contributor
timestamp: January 05, 2021, 10:04:19 am
content: Quote from: Zero999 on January 05, 2021, 09:34:58 amMany 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.

author: ricko_uk
author_rank: Super Contributor
timestamp: January 05, 2021, 02:59:20 pm
content: Thank you Ian and Zero999

author: MarkF
author_rank: Super Contributor
timestamp: January 05, 2021, 10:24:22 pm
content: Before you go too far down the rabbit hole...Checkout the AD9834:- Higher max clock (i.e. higher output frequencies)- Amplitude control (see attachment)

author: ricko_uk
author_rank: Super Contributor
timestamp: January 06, 2021, 02:38:43 pm
content: 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

author: fcb
author_rank: Super Contributor
timestamp: January 06, 2021, 02:57:50 pm
content: Quote from: ataradov on January 02, 2021, 08:27:54 amDriven 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.

author: MarkF
author_rank: Super Contributor
timestamp: January 06, 2021, 03:59:54 pm
content: Quote from: ricko_uk on January 06, 2021, 02:38:43 pmExpensive 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%3Dhttps://www.mouser.com/ProductDetail/Analog-Devices/AD9834BRUZ/?qs=BpaRKvA4VqHBu5%252BTE5Ntxw%3D%3D

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 06, 2021, 04:27:32 pm
content: Quote from: ataradov on January 02, 2021, 08:27:54 amYeah. 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.

author: ataradov
author_rank: Super Contributor
timestamp: January 06, 2021, 05:09:01 pm
content: Quote from: fcb on January 06, 2021, 02:57:50 pmThe 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.

author: fcb
author_rank: Super Contributor
timestamp: January 06, 2021, 06:58:57 pm
content: Quote from: ataradov on January 06, 2021, 05:09:01 pmBeg 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-pEven 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.

author: ataradov
author_rank: Super Contributor
timestamp: January 06, 2021, 07:32:59 pm
content: 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?

author: Ian.M
author_rank: Super Contributor
timestamp: January 06, 2021, 07:57:18 pm
content: 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!

author: fcb
author_rank: Super Contributor
timestamp: January 07, 2021, 12:34:23 am
content: 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.

author: MarkF
author_rank: Super Contributor
timestamp: January 07, 2021, 04:02:37 am
content: 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.