AnsweredAssumed Answered

8bit Pic programming of the AD9912

Question asked by greg on Jun 3, 2010
Latest reply on Jun 7, 2010 by DSB

I've been scouring the datasheet of the AD9912 in order to program it using MikroBasic for PIC's. I'd like to set it up for a 10MHz output initially, so I calculate the FTW to be  2814749767106 DEC = 028F5C28F5C2 HEX (6 Words)

 

I am using a 125MHz clock and so want to use an 8X SYSCLOCK multiplier in order to get the 1GHz DDS clock.

 

I let everything else go to default settings. When I power up my board goes to the 38MHz value as suggested on page 25 of the data sheet.

 

My procedure to program therefore is;

 

I connect my PIC's SPI MOSI port to the SDIO pin of the AD9912. I let the SDO pin do its thing through a pull down resistor

 

My program does the following;

 

STEP 1; (set SYSCLOCK)

 

I toggle the reset pin to reset the AD9912

I send the CSB line low to start a comm cycle

I then send the SYSCLOCK Address (2 words - x0020 ) followed by the SYSCLOCK data (1 word) for 8X).

I toggle the IO_update (ie low high low for 500uS)

I send the CSB high to stop the comm cycle

 

STEP 2: (set TUNING WORD)

 

I send the CSB line low to start a comm cycle

I then send the FTW Address (2 words - x01AB (MSB addy first)) followed by the FTW data (6 words MSB first) for 8X).

I toggle the IO_update (ie low high low for 500uS)

I send the CSB high to stop the comm cycle

 

Now I don't get the 10MHz as suspected - however when I change the FTW it does change the freq, but I can't predict it. I am somewhat confused by the instruction word on page 28 of the data sheet. I can see the register addresses but the datasheet suggests that the MSB bit of the instruction word indicates a read write. So I assume if its a write that MSB should be 0. Then the next two buts are the transfer length in byes. Here is where I am stumped above because the FTW is 6 Words (more than the max of 2bits). Can anyone point me in the right direction?

 

Just a last request from Analog. It would be lovely to see some example embedded code for any of the main uC's available for download, particularly a high level Basic and a C version. That would cover most peoples questions I have to think.

 

Thanks for any help

Outcomes