AnsweredAssumed Answered

AD9958 programming

Question asked by greenhorn on Jul 2, 2013
Latest reply on Jul 12, 2013 by sitti

Hi,

I am currently trying to program the AD9958 Chip via a AT91SAM3U4E mikrocontroller from Atmel, but it is not working.

The Chip select signal is set low and the SCLK is running but when i download my code there's no output on the AD9958.

This is my code:

//Configure SPI

  SPI_Config();

  //Configure Outputs

  OUT_Config();

  //master Reset, Set Pin18 HIGH

  OUT_Set(18);

  //delay in milliseconds

  delay(1);

  //Set Pin 18 LOW

  OUT_Clear(18);

  //delay in milliseconds

  delay(1);

 

 

  // Transmit data, Function Registers

  SPI_Write(0x01);                   // Instruction byte, write FR1 in MSB mode

  SPI_Write(0x800);                 // FR1 DATA

  SPI_Write(0x000);                 // FR1 DATA

  SPI_Write(0x03);                  // Instruction byte, write CFR in MSB mode

  SPI_Write(0x000);                 // CFR DATA

  SPI_Write(0x301);                 // CFR DATA

  //IO-Update

   OUT_Set(20);

  //delay in milliseconds

   delay(1);

  OUT_Clear(20);

  //delay in milliseconds

  delay(1);

 

 

  //Transmit data, FTW for each channel

  // Channel 0

  SPI_Write(0x00);              // Instruction byte, write CSR in MSB mode

  SPI_Write(0x42);              // CH0, SPI 3-Wire Mode, MSB first

  SPI_Write(0x04);              // Instruction byte, write CFTW0 in MSB mode

  SPI_Write(0x1BA5);            // FTW0 for fout=54 MHz, fclock=500 MHz, N=32

  SPI_Write(0xE354);            // FTW0 for fout=54 MHz, fclock=500 MHz, N=32

  //IO-Update

   OUT_Set(20);

  //delay

   delay(1);

  OUT_Clear(20);

  //delay in milliseconds

  delay(1);

 

 

  // Channel 1

  SPI_Write(0x00);              // Instruction byte, write CSR in MSB mode

  SPI_Write(0x82);              // CH1, SPI 3-Wire Mode, MSB first

  SPI_Write(0x04);              // Instruction byte, write CFTW0 in MSB mode

  SPI_Write(0x1BA5);            // FTW1 for fout=53.999 MHz, fclock=500 MHz, N=32

  SPI_Write(0xC1C6);            // FTW1 for fout=53.999 MHz, fclock=500 MHz, N=32

 

 

  //IO-Update

   OUT_Set(20);

  //delay

   delay(1);

  OUT_Clear(20);

  //delay in milliseconds

  delay(1);

 

  return 0;

I would be very thankful for any suggestions... i just don't get it working. The attached file is the schematic of the DDS Chip.

Thanks,

greenhorn

Attachments

Outcomes