What circuitry would you recommend to run two DDS with one Arduino?

I need to make a generator that outputs two waveforms with some frequency and relationships to each other.

How can I control two DDS such a AD9833 with one Arduino to achieve this?
Is it possbile? What would be the easiest way to do this?

Thank you.
VT

You use SPI as that's what this chip supports. See playground.

Mark

VT91:
I need to make a generator that outputs two waveforms with some frequency and relationships to each other.

Elaborate more on the "relationship" these waveforms need to have with each other. Do they need to be in a certain phase relationship with each other? Will they be the same or different frequencies?

holmes4:
You use SPI as that's what this chip supports. See playground.
Mark

Playground is where I began my research. I didn't find anything. Google didn't I mean.

Maybe the same frequency, maybe different.

Lets say I want to obtain a frequency of 9KHz and 3Khz in such way that the crest of one wave is a certaing number of degrees off from another wave's crest. Or moving two sources of the same frequency a number of degrees off each other.

A problem I may face here is that each DDS module has it's own clock source, if I am using a DDS module.

Analog devices has several application notes about synchronising dds devices e,g.

http://www.analog.com/static/imported-files/application_notes/599711852800924681833359689AN-587.pdf

Search on. Synchronise ad9833 and you will find them

I am reading. But I will unlikely proceed with building one unless someone has done it before.

I am reading. But I will unlikely proceed with building one unless someone has done it before.

Interesting... Its your choice.

Is it possbile? What would be the easiest way to do this?

Rather than asking is it possible, perhaps you should have asked the question "Has anyone built a dual output function generator using the AD9833"

As this is an entirely different question, and would have not wasted everyone's time responding to you/

i.e It does appear to be possible, but not necessarily easy (see)

What is the name of an IC that acts as a switch for a bus line if some pin in it is brought high or low?

Kind of like a gang relay in the discrete electric world. I am trying hard to google it but I cannot describe it using the right terms, perhaps.

Is this something that modern electronics would use or is this an archaic method of switching bus lines between destinations?

http://www.pongrance.com/DDS-9850.html

How are those two modules synched in this circuit?
What keeps clocks from runningat slightly different speeds?

What are you talking about?.

Communication from the Arduino to the DDS chips or something else?.

If it's communication via SPI already provides a means to do this. There are 4 lines, Master Out Slave In (MOSI) Master In Slave Out (MISO) clock these 3 form a bus to each of the SPI slave devices and then there is the Slave Select (SS) aka CS (Chip Select)

Mark

I want to add all the controls to my microcontroller-based system using two daisy-chained shift-in registers:

I am using Arduino Nano and it has a DDS connected to:
SS -(physical pin14)-(digital pin10)
MOSI-(physical pin15)-(digital pin11)
SCK -(physical pin13)-(digital pin17)

CD 4021 shift-in registers use something similar to serial communication.
Should I connect them to serial pins, the way my DDS is connected an switch between devices periodically, or should I connect my pins for shift-in registers somewhere else?

I am using shift-in registers to wire 4 rotary encoders to the microcontroller.
They have to be checked periodically to see if there was a change in the position.
There may be a button on my device that will tell the program "go check the knobs as there is going to be user input"

I will write a tutorial when all my hardware and software will work and nothing will burn.

Are these absolute or incremental encoders? Because I would think that trying to handle 4 incrementals via a shift reg would be an issue, and if you only read them when a button is pressed can you determine the direction they were turned?

How are those two modules synched in this circuit?
What keeps clocks from runningat slightly different speeds?

I gather you are referring to the fact that the CLK pins on both chips are note connected? They are driven by the Arduino so it's up to you the keep them the same. That said if you want them to be identical just join them together.

You connect most shift registers to either SPI or use any pins and shiftIn().


Rob

SPI works by having the Master select the slave with which it wishes to take. Think about it as a class room. On teacher (the master) lots of slaves (opps I mean kids). Teacher points at one and says "You Smith, what is ..........." and Smith answser ......

For SPI we have the SS pin(s) - this allows us to select (Teacher points at .. Smith) the unit that will reply. No need for any kind of shift reg,.

Mark

Sorry for writing to the same topic.

I am running in shifts independently of DDS. Should I use MOSI and SCK for in shifts and use SS pins to choose between two or should I use any user-determined digital pins to read inputs of in-shifts?

My program will scan encoders for a period of time after change has been detected.

I am just wondering if I need to use SPI for in-shifts. I should pick a designated SS pin and wire it to Latch Pin ?
Should I use MISO since I am dealing with an input from in-shifts VS output to DDS?

Or can I just connect my two in-shift ICs to any 3 digital pins as it is shown in in-shift tutorial?

//define where your pins are
int latchPin = 8;
int dataPin = 9;
int clockPin = 7;

Should I use MOSI and SCK for in shifts and use SS pins to choose between two or should I use any user-determined digital pins to read inputs of in-shifts?

You can use SPI or shiftIn/Out, it's up to you. SPI will be a lot faster.

My program will scan encoders for a period of time after change has been detected.

Sounds a bit suss to me, but if you're happy it will work...


Rob

Graynomad:

Should I use MOSI and SCK for in shifts and use SS pins to choose between two or should I use any user-determined digital pins to read inputs of in-shifts?

You can use SPI or shiftIn/Out, it's up to you. SPI will be a lot faster.

My program will scan encoders for a period of time after change has been detected.

Sounds a bit suss to me, but if you're happy it will work...


Rob

MISO for input to microcontroller, MOSI for output from microcontroller?

Yep.


Rob

The tutorial says:

CD4021B

Pin3 -- DATA pin -- MISO ->Blue wire -- library
Pin9 -- Latch pin -- SS ->Green wire -- programmer defined
Pin10 -- Clock pin -- SCK ->Yellow wire -- library

Did I match the tutorial CD4021B pins with the microcontroller SPI pins correctly?

If I want information to go in and out of the microcontroller, I use MOSI and MISO or are they interchangeable in some cases?
This is not related to current project.

Thank you!

Tutorial pins aren't referred by their SPI names, What are their SPI counterparts? Thanks.

I just had a look at the tutorial, it seems very clear but it's not about using SPI, it's about using shiftIn(). So select whatever pins you like for clock/latch/dataPin.

That said, after a quick look at the 4021 data sheet I think MISO would go to pin 3 (Q8), SCK would go to pin 10, and your CS (not SS) would go to pin 9.


Rob