Electronics > Projects, Designs, and Technical Stuff

How to use DAC7821?

<< < (4/4)

T3sl4co1l:
How about a separate oscillator into an MDAC?  Only need to update it once in a while.  By "sine wave" I presume there are no phase or frequency changes; or really amplitude either, as a sine wave is eternal.  But "sine wave" is typically used loosely, so I'm making light of these here...

...Which can be injection locked, or digitally tuned; of course the hardware-complexity tradeoff quickly gets out of hand, but there may be a middle ground where it's suitable.

Also, distortion, spurs, etc.?  SINAD?  Not crazy I guess if 12 bits is adequate, but depends on how much overhead you need for the sample rate.

(If distortion doesn't need to be impressive, it could even be a well-filtered timer output (square wave) into an MDAC, in which case phase/frequency is directly controllable again.)

Tim

ejeffrey:

--- Quote from: rcbuck on August 31, 2020, 02:24:24 am ---I should have mentioned one more thing. It needs to have a 12 bit data bus. My processor instruction time is 72 MHz and I need to do other things between the 16.6667 usec sine wave updates. So I don't have time for serial transmissions or multiple addressing modes.

Cost is also a factor. I would like to keep the DAC below $10. Ultimately the real solution is probably a much faster processor (STM32F407) so the DAC specs can be changed to serial mode.

At this time I am just trying to prove my idea will work. The DAC7821 will certainly work if it were simple to implement.

--- End quote ---

Can you use a DDS chip? They can be pretty cheap and generate good sine waves.  You can update the tuning words over SPI as quickly as your micro can keep up.

rcbuck:
I am using a dsPIC33EV256GM106 that does have SPI. But the Processor is not fast enough to have a SPI DAC work at 60 kHz and generate 48 sample points from a lookup table.

The sine wave will not change frequency. However, I want to change the phase by 180 degrees every 2 seconds Distortion isn't really a concern.

I have finally decided a R2R ladder DAC is the simplest guaranteed way to work. At least for my initial testing.

Attached jpg is an example of what I want to do. You can see the 180 degree change at the center of the sine wave pattern.

I may be approaching this from the wrong perspective. As ejeffrey mentioned, DDS may be the real answer. The AD9838 has IOUT and IOUTB outputs. Page 15 of the data sheet says the outputs are differential in operation. I could make the phase change using a SPDT switch such as the NLAS4157 or TS5A3159. The only problem is the phase change would just be random (without additional hardware) instead of at zero crossing. But that shouldn't matter in my application since there is no hardware being controlled.

Has anyone worked with the AD9838 part? Do the pads wrap around the outside of the case or are the side pads just for alignment?

NiHaoMike:

--- Quote from: rcbuck on September 01, 2020, 10:21:10 pm ---I am using a dsPIC33EV256GM106 that does have SPI. But the Processor is not fast enough to have a SPI DAC work at 60 kHz and generate 48 sample points from a lookup table

--- End quote ---
You don't need a sample rate 48x the output frequency. Theoretically, it can be done with just 2x the output frequency, but in practice, 4x or more makes it easier to filter the output. The easiest way to do it is to use an audio DAC that oversamples internally.

ejeffrey:

--- Quote from: rcbuck on September 01, 2020, 10:21:10 pm ---The sine wave will not change frequency. However, I want to change the phase by 180 degrees every 2 seconds Distortion isn't really a concern.

--- End quote ---

This is made for a DDS!  No need to use a switch to flip the phase, the DDS has this capability built in.  It has two phase registers, and you can flip back and forth using a single control register write.  There are other DDS chips that actually have input pins that you can drive with a GPIO to select between different phase/frequency registers, but the AD9838 does not have this feature.  At 0.5 Hz however it isn't really needed.

You can make this synchronous by using the same clock (or divided copy) for both the microcontroller and the DDS chip.  That should allow you to do zero crossing switching if you are careful, no extra hardware needed.


--- Quote ---Has anyone worked with the AD9838 part? Do the pads wrap around the outside of the case or are the side pads just for alignment?
--- End quote ---

I haven't worked with the AD9838 but I have worked with higher speed analog devices DDS chips.  They are great for this type of application. As for the package, yes the leads wrap around the side of the package a bit.  These are small but you can solder them by hand with some magnification -- except for the exposed pad.  I've soldered packages like this on a hot plate with no problem.

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod