EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: ricko_uk 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 (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 :)
-
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.
-
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.
-
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 (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.
-
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.
-
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.
-
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 (https://assets.nexperia.com/documents/data-sheet/74LVC2GU04.pdf) 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.
-
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 (https://www.ti.com/lit/ds/symlink/sn74lvc1gx04-ep.pdf)
-
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.
-
Thank you all for the feedback and suggestions, Much appreciated as usual!! :)
-
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
-
Thank you Tim :)
-
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 (https://www.ti.com/lit/ds/symlink/sn74lvc1404.pdf)
-
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 (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.
-
Thank you Ian and Zero999 :)
-
Before you go too far down the rabbit hole...
Checkout the AD9834:
- Higher max clock (i.e. higher output frequencies)
- Amplitude control (see attachment)
-
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
-
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.
-
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/AD9833BRMZ/?qs=BpaRKvA4VqFt3Bdw9RBKCQ%3D%3D)
https://www.mouser.com/ProductDetail/Analog-Devices/AD9834BRUZ/?qs=BpaRKvA4VqHBu5%252BTE5Ntxw%3D%3D (https://www.mouser.com/ProductDetail/Analog-Devices/AD9834BRUZ/?qs=BpaRKvA4VqHBu5%252BTE5Ntxw%3D%3D)
-
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.
-
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.
-
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.
-
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?
-
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!
-
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.
-
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.