example ad5930 code

AD5930 datasheet(1/28 Pages) AD | Programmable Frequency Sweep and Output Burst Waveform Generator is the data sheet for the ad5930.
how to start the chip i understand, but how to get a frequency or how to get it to sweep frequency or how to limit the frequency i do not understand and google has not given much help.
has anyone programmed the ad5930, and if so would you post your code?

page 17 of 28 starts talking about programming the ad5930.

This is the official page of the Manufacturer with all the information and documents:

I could not find Arduino code for it yet.
This project has assembly code:
http://www.myplace.nu/avr/minidds/index.htm
This project doesn't seem to publish the code:
https://web.archive.org/web/20171012070451/http://www.uchobby.com/index.php/2007/10/03/siggen1-is-alive/

A few users on the forum know about DDS, let's hope one of them replies !

According to fig. 4 in the datasheet the chip is programmed using the SPI interface, mode 1, SCLK to SCLK, MOSI to SDATA and SS (or any other pin you want to use for that functionality) to FSYNC. You don't have to connect MISO because the chip doesn't respond.

I also couldn't find an Arduino library for it, so you probably have to write the software yourself.

Caltoa:
This is the official page of the Manufacturer with all the information and documents:
http://www.analog.com/en/rfif-components/direct-digital-synthesis-dds/ad5930/products/product.html

I could not find Arduino code for it yet.
This project has assembly code:
http://www.myplace.nu/avr/minidds/index.htm
This project doesn't seem to publish the code:
SigGen1 Is Alive – uCHobby

A few users on the forum know about DDS, let's hope one of them replies !

thank you.

this project uses a 16 pin ad5932, and i have a 20 pin ad5930.
was wondering why my google search did not show this project. took me a little while to figure out the answer. the two chips are close, so maybe it will help.
and thanks again.

I found a snip-it of code on:

however, it says "I've not included specifics like writing to the SPI because it's specific to your compiler/MCU. I'm using CCS C.", which the main part i need is how to write to the ad5930.

As it uses SPI look at SPI in the playground. You won't find a specific arduino lib for the chip.

Mark

it is a noobs assumption, but it looks like the spi lib is what i was looking for. at least a part of what i was looking for.

here is the code based on my very limited understanding of the data sheet:

unsigned int const CONTROL        = 0b0000111111101111;
//?? min num 2
unsigned int const NUM_INCREMENT  = 0b0001000000000010; 
//?? 101 fixed clock time, _ _ _ 1  1 time multiplier
unsigned int const BURST_INTERVAL = 0b1011100000000000;  
//?? Lower delta frequency bit
unsigned int const LDFB           = 0b0010000000000000;
//?? Higher delta frequency bit
unsigned int const HDFB           = 0b0011000000000000;
//?? 
unsigned int const LSFB           = 0b1100000000000000;
//?? 
unsigned int const HSFB           = 0b1101000000000000;
  
void setup() 
{
  // put your setup code here, to run once:
  //?? Serial Data Input
  pinMode(A4, OUTPUT);
  
  //?? Serial Clock Input
  pinMode(A5, OUTPUT);
  
  //?? FSYNC
  pinMode(2, OUTPUT);
  
  //?? CTRL
  pinMode(3, OUTPUT);
  
  //?? MSBOUT
  pinMode(4, INPUT);
  
  //?? SYNCOUT
  pinMode(5, INPUT);
  
  //?? ?
  /*
  D0:  reserved,      must be                                        1
  D1:  reserved,      must be                                        1
  D2:  SYNCOUTEN,     SYNC pin on                                    1
  D3:  SYNCSEL,       returns high at end of EOS                     1
  D4:  MODE,          triangle sweep         [saw sweep  1]          0
  D5:  INT/EXT INCR,  frequency increments are triggered by CTRL pin 1
  D6:  INT/EXT BURST, ???? works withD5 and D7                       1
  D7:  CW/BURST,      continously                                    1
  D8:  MSBOUTEN,      MSBOUT pin enabled                             1
  D9:  SINE/TRI       sine wave           [triangular wave  0]       1
  D10: DAC ENABLED,   0 if only using MSB data, saves power          1 //?? need to fine out about DAC
  D11: B24,           complete word in two consecutive writes        1
  
        Register address bits
  D15, D14, D13, D12
  0,0,0,0  control bits
  0,0,0,1  num increments
  0,0,1,0  lower 12 bit delta frequency
  0,0,1,1  higher 12 bit delta frequency
  0,1, ,   increment interval            //?? not usde if CTRL is used?
  1,0, ,   Burst interval
  1,1,0,0  lower 12 bit start frequency
  1,1,0,1  higher 12 bit start frequency
  */
  
  //?? first control bits
  shiftOut(A4, A5, LSBFIRST, CONTROL);
  //?? num increments
  shiftOut(A4, A5, LSBFIRST, NUM_INCREMENT);
  //?? lower 12 bit delta frequency
  shiftOut(A4, A5, LSBFIRST, LDFB);
  //?? higher 12 bit delta frequency
  shiftOut(A4, A5, LSBFIRST, HDFB);
    
  Serial.begin(9600);
  
}

void loop() 
{
  // put your main code here, to run repeatedly:
  //?? 12 bit number
  unsigned int iMaxByte = 0b111111111111;
  unsigned int iLowbit = 0;
  unsigned int iHighbit = 0;
  
  unsigned int i_lsfb = 0;
  unsigned int i_hsfb = 0;
  
  int i = 0;
  int iReturn = 0;
  
  while(true)
  {
   
    //?? shiftOut(dataPin, clockPin, bitOrder, value)   LSBFIRST
    //?? shiftOut(A4, A5, LSBFIRST, value)
    //?? byte incoming = shiftIn(dataPin, clockPin, bitOrder)
    //?? byte incoming = shiftIn(dataPin, A5, LSBFIRST)
    
    //?? lower 12 bit start frequency
    i_lsfb = LSFB + iLowbit;
    shiftOut(A4, A5, LSBFIRST, i_lsfb);
    
    iLowbit = iLowbit + 100;
    
    if(iLowbit > iMaxByte)
    {
      iLowbit = 0;
      iHighbit++;
      
      if(iHighbit > iMaxByte)
      {
        iHighbit = 0;
        SoundAlarm();
      }
    }
    
    //?? higher 12 bit start frequency
    i_hsfb = HSFB + iHighbit;
    shiftOut(A4, A5, LSBFIRST, i_hsfb); 
    
    //?? read pin 4, 5
    //?? MSBOUT pin 4  , inverted MSB of the DAC data
    byte incomingL = shiftIn(4, A5, LSBFIRST);
    
    //?? SYNCOUT pin 5 , end of sweep EOS
    byte incomingH = shiftIn(5, A5, LSBFIRST);
    
    //?? increments to next frequecy
    digitalWrite(3,HIGH);
    digitalWrite(3,LOW);
    //Serial.print("end");
    //Serial.print('\n');
    Serial.print(i++);
    Serial.print(", ");
    
    iReturn++;
    if(iReturn > 19)
    {
      Serial.print('\n');
      iReturn = 0;
    }
    
    if((incomingL > 0) || (incomingH > 0))
    {
      i = 0;
      iReturn = 0;
      Serial.print('\n');
      
      Serial.print("out going lowbit = ");
      Serial.print(iLowbit);
      Serial.print('\n');
      
      Serial.print("out going highbit = ");
      Serial.print(iHighbit);
      Serial.print('\n');
      
      Serial.print("incoming 4 = ");
      Serial.print(incomingL);
      Serial.print('\n');
      
      Serial.print("incoming 5 = ");
      Serial.print(incomingH);
      Serial.print('\n');
      
      Serial.print('\n');
    }
    
    //?? pause
    delay(1000);
  }
  
}

//?? and it does what?
void SoundAlarm()
{
  Serial.print("alarm");
  Serial.print('\n');
}

here is the output:

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 0
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 0
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 0
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 0
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 0
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 1
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 1
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 1
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 1
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 1
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 1
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 2
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 2
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 2
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 2
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 2
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 2
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 3
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 3
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 3
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 3
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 3
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 3
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 4
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 4
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 4
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 4
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 4
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 4
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 5
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 5
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 5
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 5
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 5
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 5
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 6
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 6
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 6
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 6
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 6
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 6
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 7
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 7
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 7
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 7
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 7
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 7
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 8
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 8
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 8
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 8
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 8
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 8
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 9
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 9
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 9
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 9
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 9
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 9
incoming 4 = 255
incoming 5 = 255
------------
cut
------------
0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 0
out going highbit = 14
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 
out going lowbit = 500
out going highbit = 14
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 1300
out going highbit = 14
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2100
out going highbit = 14
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 4, 5, 6, 7, 
out going lowbit = 2900
out going highbit = 14
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3, 
out going lowbit = 3300
out going highbit = 14
incoming 4 = 255
incoming 5 = 255

0, 1, 2, 3,

I have four chips. First one would goto about 128 or 16 before getting output from MSBOUT, but not SYNCOUT. This out put is from 4th chip. All chips gave out 0.00 to 0.1 micro-amps.

output is 0.99 Hz to 2.99 Hz. It goes to zero Hz when MSBOUT gives a signal.

just had a duh moment, i declared A5 to be clock, but did not tell arduino that it was to send clock to anything.

[edit]
thought i did with "shiftOut(A4, A5,", but i am so confused.

[edit]
I did not use the MCLK pin, which may be an issue, because i was using clock from A5, however it is not continues.
It is the fact that MSBOUT and SYNCOUT [on one of 4 chips] is giving output, makes me wonder if code works but chips are damaged.

[edit]
just found this:
shiftOut is currently written to output 1 byte (8 bits) so it requires a two step operation to output values larger than 255.

// Do this for MSBFIRST serial
int data = 500;
// shift out highbyte
shiftOut(dataPin, clock, MSBFIRST, (data >> 8 ));
// shift out lowbyte
shiftOut(dataPin, clock, MSBFIRST, data);

// Or do this for LSBFIRST serial
data = 500;
// shift out lowbyte
shiftOut(dataPin, clock, LSBFIRST, data);
// shift out highbyte
shiftOut(dataPin, clock, LSBFIRST, (data >> 8 ));

code needed to be modified

[edit]
still no frequency output, and volt & amp is very low.

would someone help with this project?
currently trying to figure out how to get continuous clock output to MCLK pin on AD5930

using 62.41 kHz, i get:

0, 1, 
out going lowbit = 1800
out going highbit = 6
incoming 4 = 201
incoming 5 = 204

0, 
out going lowbit = 1900
out going highbit = 6
incoming 4 = 146
incoming 5 = 19

0, 
out going lowbit = 2000
out going highbit = 6
incoming 4 = 109
incoming 5 = 228

0, 
out going lowbit = 2100
out going highbit = 6
incoming 4 = 100
incoming 5 = 102

0, 1, 2, 3, 4, 5, 6, 
out going lowbit = 2800
out going highbit = 6
incoming 4 = 109
incoming 5 = 100

0, 
out going lowbit = 2900
out going highbit = 6
incoming 4 = 154
incoming 5 = 153

0, 1, 2, 3,

which changed what the AD5930 was sending, but still nothing for output frequency, and volt & amp are unchanged.

Why are you using a software emulation (done by yourself) for the SPI functionality? Why not using the hardware SPI and the Arduino SPI library?

pylon:
Why are you using a software emulation (done by yourself) for the SPI functionality? Why not using the hardware SPI and the Arduino SPI library?

got the software emulation to work, but not the spi libray. i keep going back and forth, but it is the software emulation that gives something out.

using:

#include <Wire.h>
//#include <SPI.h>

unsigned int const CONTROL        = 0b0000111111101111;
//?? min num 2
unsigned int const NUM_INCREMENT  = 0b0001000000000010; 
//?? 101 fixed clock time, _ _ _ 1  1 time multiplier
unsigned int const BURST_INTERVAL = 0b1011100000000000;  
//?? Lower delta frequency bit
unsigned int const LDFB           = 0b0010000000000000;
//?? Higher delta frequency bit
unsigned int const HDFB           = 0b0011000000000000;
//?? 
unsigned int const LSFB           = 0b1100000000000000;
//?? 
unsigned int const HSFB           = 0b1101000000000000;

unsigned int m_iLowbit = 500;
unsigned int m_iHighbit = 0;
  
byte m_incomingL = 0;
byte m_incomingH = 0;

int m_iFlag = 0;

void setup() 
{
  // put your setup code here, to run once:
  Wire.begin();
  //SPI.begin();
  //SPI.setBitOrder(LSBFIRST);
  
  //?? Serial Data Input
  pinMode(A4, OUTPUT);
  
  //?? Serial Clock Input
  pinMode(A5, OUTPUT);
  
  //?? FSYNC
  pinMode(2, OUTPUT);
  
  //?? CTRL
  pinMode(3, OUTPUT);
  
  //?? MSBOUT
  pinMode(4, INPUT);
  
  //?? SYNCOUT
  pinMode(5, INPUT);
  
  pinMode(6, OUTPUT);
  TCCR0B = 0b00000001;
  analogWrite(6, 128);
  
  //?? ?
  /*
  D0:  reserved,      must be                                        1
  D1:  reserved,      must be                                        1
  D2:  SYNCOUTEN,     SYNC pin on                                    1
  D3:  SYNCSEL,       returns high at end of EOS                     1
  D4:  MODE,          triangle sweep         [saw sweep  1]          0
  D5:  INT/EXT INCR,  frequency increments are triggered by CTRL pin 1
  D6:  INT/EXT BURST, ???? works withD5 and D7                       1
  D7:  CW/BURST,      continously                                    1
  D8:  MSBOUTEN,      MSBOUT pin enabled                             1
  D9:  SINE/TRI       sine wave           [triangular wave  0]       1
  D10: DAC ENABLED,   0 if only using MSB data, saves power          1 //?? need to fine out about DAC
  D11: B24,           complete word in two consecutive writes        1
  
        Register address bits
  D15, D14, D13, D12
  0,0,0,0  control bits
  0,0,0,1  num increments
  0,0,1,0  lower 12 bit delta frequency
  0,0,1,1  higher 12 bit delta frequency
  0,1, ,   increment interval            //?? not usde if CTRL is used?
  1,0, ,   Burst interval
  1,1,0,0  lower 12 bit start frequency
  1,1,0,1  higher 12 bit start frequency
  */
  
  //?? first control bits
  shiftOut(A4, A5, LSBFIRST, CONTROL);
  shiftOut(A4, A5, LSBFIRST, (CONTROL >> 8) );
  //?? num increments
  shiftOut(A4, A5, LSBFIRST, NUM_INCREMENT);
  shiftOut(A4, A5, LSBFIRST, (NUM_INCREMENT >> 8) );
  //?? lower 12 bit delta frequency
  shiftOut(A4, A5, LSBFIRST, LDFB);
  shiftOut(A4, A5, LSBFIRST, (LDFB >> 8) );
  //?? higher 12 bit delta frequency
  shiftOut(A4, A5, LSBFIRST, HDFB);
  shiftOut(A4, A5, LSBFIRST, (HDFB >> 8) );
    
  Serial.begin(9600);
  
}

void loop() 
{
  // put your main code here, to run repeatedly:
  //?? 12 bit number
  
  int i = 0;
  int iReturn = 0;
  
  while(true)
  {
   
    //?? shiftOut(dataPin, clockPin, bitOrder, value)   LSBFIRST
    //?? shiftOut(A4, A5, LSBFIRST, value)
    Transmit();
    
    //?? byte incoming = shiftIn(dataPin, clockPin, bitOrder)
    //?? byte incoming = shiftIn(dataPin, A5, LSBFIRST)
    if(Recieve() == true)
    {
      i = 0;
      iReturn = 0;
    }
    
    //?? increments to next frequecy
    digitalWrite(3,HIGH);
    digitalWrite(3,LOW);
    //Serial.print("end");
    //Serial.print('\n');
    if(i > 0)
    {
       Serial.print(i);
       Serial.print(", ");
    }
    i++;
    
    iReturn++;
    if(iReturn > 19)
    {
      Serial.print('\n');
      iReturn = 0;
    }
    
    
    
    //?? pause
    //delay(10);
  }
  
}

//?? and it does what?
void SoundAlarm()
{
  Serial.print("alarm");
  Serial.print('\n');
}


//??
void Transmit()
{
  //?? lower 12 bit start frequency
  unsigned int iMaxByte = 0b111111111111;
  
  unsigned int i_lsfb = 0;
  unsigned int i_hsfb = 0;

  i_lsfb = LSFB + m_iLowbit;
  shiftOut(A4, A5, LSBFIRST, i_lsfb);
  shiftOut(A4, A5, LSBFIRST, (i_lsfb >> 8) );
  
  m_iFlag++;
  
  if(m_iFlag > 10000)
  {
    m_iFlag = 0;
    m_iLowbit = m_iLowbit + 100;  
  }
    
  if(m_iLowbit > iMaxByte)
  {
    m_iLowbit = 0;
    m_iHighbit++;
    Serial.print("\n");
    Serial.print(m_iHighbit);
    Serial.print("\n");
      
    if(m_iHighbit > iMaxByte)
    {
      m_iHighbit = 0;
      SoundAlarm();
    }
  }
    
  //?? higher 12 bit start frequency
  i_hsfb = HSFB + m_iHighbit; 
  shiftOut(A4, A5, LSBFIRST, i_hsfb);
  shiftOut(A4, A5, LSBFIRST, (i_hsfb >> 8) );
    
 /*
  Serial.print(",  ");
  Serial.println(i_lsfb, BIN);
  Serial.print(",  ");
  Serial.println((i_lsfb >> 8), BIN);
  Serial.print(",  ");
  Serial.println(i_hsfb, BIN);
  Serial.print(",  ");
  Serial.println((i_hsfb >> 8), BIN);
  
  Serial.print("\n");  
  */
}

//??
bool Recieve()
{
  for(int i = 0; i < 100; i++)
  {
    //?? read pin 4, 5
    //?? MSBOUT pin 4  , inverted MSB of the DAC data
    m_incomingL = shiftIn(4, A5, LSBFIRST);
    
    //?? SYNCOUT pin 5 , end of sweep EOS
    m_incomingH = shiftIn(5, A5, LSBFIRST);
    
    if((m_incomingL > 0) || (m_incomingH > 0))
    {
      if(i > 0)
      {
         Serial.print('\n');
         Serial.print(i);
         Serial.print('\n');
      }
      
      if(m_iFlag < 1)
      {  
         Serial.print(" , recieved ");
         Serial.print(m_iFlag);
         Serial.print("\n");
         
         Serial.print("out going lowbit = ");
         Serial.print(m_iLowbit);
         Serial.print('\n');
      
         Serial.print("out going highbit = ");
         Serial.print(m_iHighbit);
         Serial.print('\n');
      
         Serial.print("incoming 4 = ");
         Serial.print(m_incomingL);
         Serial.print('\n');
      
         Serial.print("incoming 5 = ");
         Serial.print(m_incomingH);
         Serial.print('\n');
      }
      else
      {  
         //Serial.print(" , recieved ");
         //Serial.print(m_iFlag);
         //Serial.print(", ");
      }
      return true;
    }
      //?? pause
      //delay(10);
  }  
  
  return false;
}

gives:
, recieved 0
out going lowbit = 2200
out going highbit = 1
incoming 4 = 255
incoming 5 = 255
, recieved 0
out going lowbit = 2300
out going highbit = 1
incoming 4 = 255
incoming 5 = 255
, recieved 0
out going lowbit = 2400
out going highbit = 1
incoming 4 = 255
incoming 5 = 255
, recieved 0
out going lowbit = 2500
out going highbit = 1
incoming 4 = 255
incoming 5 = 255

however, i have to upload and open serial monitor in just the right time span, or else syncout nor msbout never give anything out.
finally got 3 led's in parallel to light and a frequency rapidly change between 288 and 318 Hz

Clean up your code! What is that Wire.begin() for? Wire the setup for the hardware SPI and change your code accordingly. Post that (cleaned up) code and a photo of your wiring (so that all wire connections are visible).