AnsweredAssumed Answered

Programming AD9952

Question asked by FatSpock on Aug 13, 2013
Latest reply on Aug 17, 2013 by LouijieC

Hi,

 

I am trying to program an AD9952 to produce a 1MHz square wave however I am getting nothing from the Comparator Output pin. I used my scope and sniffed the SPI lines to confirm that I am sending the correct bytes. 

 

void nco_Freq_Tunning(char FTW[sizeof(Uint32)])

{

    char Test_array[4];

    Test_array[0] = FTW[0]&0x00FF;

    Test_array[1] = (FTW[0]>>8)&0x00FF;

    Test_array[2] = FTW[1]&0x00FF;

    Test_array[3] = (FTW[1]>>8)&0x00FF;

 

   int i = 0;

          EALLOW;

          GpioDataRegs.GPACLEAR.bit.GPIO22 = 1;

          EDIS;

 

          for(i=0;i<10;i++)

          {};

 

          SpibRegs.SPITXBUF = 0x04<<8;

          while(SpibRegs.SPIFFTX.bit.TXFFST != 0)

          {};

 

          SpibRegs.SPITXBUF = Test_array[3]<<8;

          SpibRegs.SPITXBUF = Test_array[2]<<8;

          SpibRegs.SPITXBUF = Test_array[1]<<8;

          SpibRegs.SPITXBUF = Test_array[0]<<8;

 

          while(SpibRegs.SPIFFTX.bit.TXFFST != 0)

          {};

 

          for(i=0;i<10;i++)

          {};

          nco_Update_Regs();

 

          EALLOW;

          GpioDataRegs.GPASET.bit.GPIO22 = 1;

          EDIS;

}

 

void nco_Update_Regs()

{

   int i;

   for(i=0;i<10;i++)

   {};

   EALLOW;

   GpioDataRegs.GPBSET.bit.GPIO42 = 1;

   EDIS;

   for(i=0;i<=10;i++)

   {};

   EALLOW;

   GpioDataRegs.GPBCLEAR.bit.GPIO42 = 1;

   EDIS;

   for(i=0;i<=10;i++)

   {};

}

Outcomes