Just a follow up to the previous post.
For reference, here's the "schematic" for the setup I used with the above code. There are a couple of different modules in circulation so make sure the actual signals and not the pin numbers matches your particular module.

Name:  AD9850-setup.jpg
Views: 9060
Size:  41.7 KB

If you're programming the PIC in-circuit perhaps the programmer is loading RB6, RB7 (since they are the programming pins) preventing them from operating the AD9850 properly? I'm doing just that with a PICKit3 on my breadboard and don't see any issues but it's a thought.

/Henrik.