I am driving an AD9851 DDS frequency synthesiser chip. There are four lines required for serial data transfer. These control lines are FQ_UD (pin 8) which transfers data from the buffer to the main register, W_CLK (pin 7), serial data D7 (pin 25) and Master Reset (pin 22).
Note that step 3 below is where a single pulse is required on the clock line, thereafter the transfer is normal SPI so hspisetup could occur after step 3. The only problem that may occur is if an error recovery routine then needs to go through a hardreset and restart at step 2 as hspisetup would then have been run so would have to do an 'hspisetup off' command first.
For serial mode, hard code pins 2, 3, and 4 per figure 18 in the AD8951 data sheet. The seuence to initialise is as follows:-
1) Apply power and REF CLK source to pin 9.
2) Send a master reset pulse. (this places the device in default state and the part is in parallel mode)
3) Send one W_CLK pulse, then send one FQ_UD (this places the device in serial mode)
4) Using W-CLK and D7 load 40 zeros first and then send one FQ_UD. (D7 is the serial data pin). This clears rubbish from the registers.
5) Now using W_CLK and D7 load the next forty bits (five bytes) with your desired FTW (frequency control word) setting and then send one FQ_UD. The correct frequency should be at the output.
Hope this gives an idea of what I'm doing. The actual prpoject is to use a cheap (£7 on eBay) AD9851 board as a signal generator for 1Hz to 70MHz in 1Hz steps with sine and square wave outputs..
Dick