an evaluation of AD5930 are emergency nedded

Status
Not open for further replies.

beni_annis

Junior Member level 2
Joined
Jan 15, 2011
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Germany
Visit site
Activity points
1,392
Dear all,

can anyone help be to program the AD5930, I mean does anyone have Evaluation Tools for AD5930, I will be very thankful for your help. I will pay all the postages costs. Thank you very much for your help in advance.
 

I'll answer here instead of your PM...

The AD5930 does not need to be (and cannot be) 'programmed' the way you think - it is controlled/programed at start up by a microcontroller.

It is very easy to set up from a microcontroller; as a minimum, connect up the SPI bus, Fsync and Ctrl lines to the MCU. That will enable you to load values into the AD5930 and start it running.

The datasheet gives very good guidance on how to send the control words.
 
Thanks a lot for this information, in matter of fact I'm little bit new in this field and I found in the data-sheet and also in the website talking about the evaluation kit (costs 99 dollar). I will try your method I hope I can do it. Thanks again for the information .
 

My project has slowed a little due to other commitments, but it's working fine on breadboard. When I get the chance right now I'm alternating between finalising the analogue output stages (by far the most complicated part of the system) and trying to squeeze the code into a small PIC. I could go for a bigger PIC and make life easy but I'm being difficult, lol.

Controlling the AD5930 really is as simple as:

Start with Fsync high and Ctrl low (control lines from MCU to AD5930)
Bring Fsync low to enable the AD5930 to accept data.
Send the control words as given in the datasheet over SPI.
Bring Fsynk high to stop transfer and process data in the AD5930
Pulse Ctrl high to begin frequency output.

If you need some actual code, I might be able to post later today or tomorrow, depending on how busy I am.
 
well, thank you so much for your valuable help, I really can not find any words how to thank you. for sure code will be very helpful
 

Here's a quick code excerpt. You can extrapolate it for the other control registers etc.

Basically, I make some unions to hold the AD5930 register values in the PIC. that way, I can write a value to the .word, then access it as .byte for sending to the SPI port.

You can also see how the control words themselves (an address, plus data part) are configured and sent in the sample functions.

Check the datasheet and you will see that the functions put the correct bits in the correct places for the relevant registers. Again, you can extrapolate them for the other registers.

I've not included specifics like writing to the SPI because it's specific to your compiler/MCU. I'm using CCS C.

I hope it gives you some ideas.

Code:
//Unions to make accessing bytes (for sending to SPI) and individual bits easier

   union {                       // Control word, 16 bits
      unsigned int16 word;
      struct {
         unsigned int8 byte1;
         unsigned int8 byte2;
         } bytes;
      struct {
         unsigned int Reserved1:1;
         unsigned int Reserved2:1;
         unsigned int SyncOutEn:1;   // Enable SyncOutput
         unsigned int SyncSel:1;     // SyncOutput control
         unsigned int Mode:1;        // Sweep envelope: 0: Triangle, 1=Ramp
         unsigned int IntExtIncr:1;  // 0=Incr controlled internally
         unsigned int IntExtBurst:1; // 0=Burst controlled internally
         unsigned int CWBurst:1;     // CW/Burst
         unsigned int MSBOutEn:1;    // Enable MSB output
         unsigned int TriSine:1;     // 0=Triangle, 1=Sine output
         unsigned int DACEnable:1;   // DAC Enable
         unsigned int B24:1;         // 0=use seperate 12-bit regs, 1=use 24-bit load
         unsigned int addr:4;        // Register Address
         } bits;
      } Ctrl;          // Control word
   
   union {                       // Starting Frequency, 24 bits
      unsigned int32 word;
      struct {
         unsigned int8  byte1;
         unsigned int8  byte2;
         unsigned int8  byte3;
         unsigned int8  byte4;
         } bytes;
      } Freq;

   union {                       // Number of Increments, 12 bits, minimum=0x02
      unsigned int16 word;  
      struct {
         unsigned int8  byte1;
         unsigned int8  byte2;
         } bytes;
      } Nincr;   
   

void write_ctrl()
{
   spi_write(DDS[selectDDS].Ctrl.bytes.byte2);
   spi_write(DDS[selectDDS].Ctrl.bytes.byte1);
}

void write_freq()
{
   spi_write((DDS[selectDDS].Freq.bytes.byte2&0b00001111) | 0b11000000);
   spi_write(DDS[selectDDS].Freq.bytes.byte1);
   spi_write((DDS[selectDDS].Freq.bytes.byte3>>4) | 0b11010000);
   spi_write((DDS[selectDDS].Freq.bytes.byte2>>4) | (DDS[selectDDS].Freq.bytes.byte3<<4));
}

void write_nincr()
{
   spi_write(DDS[selectDDS].Nincr.bytes.byte2 | 0b00010000);
   spi_write(DDS[selectDDS].Nincr.bytes.byte1);
}
 
For sure it gave a big idea how it is going, great work from you Rick, Thanks a lot I really appreciate that
 

Hi,
I am also trying to get this IC working, but I am a little confused of the datasheet.
Can someone guide me the right initialization sequence to set the AD5930 to work in continious mode, square wave signal, fixed frequency?
Later in the program I will just write the desired frequency by SPI...
Please help!
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…