Hi,
Sorry for the late reply, you've probably figured it out by now.
But in case you haven't, have you verified that your PIC is actually running?
I've just tried the following code here, all wired up on a breadboard using a 16F628 using a 4MHz x-tal and a AD9850 module, compiled with PBP 3.0.6.4. Module forced into serial mode by tying D0,D1 high and D2 low. It outputs a 500kHz signal as expected:Here's the result:Code:DEFINE OSC 4 Clk VAR PortB.5 ' Clock output pin Dta VAR PortB.6 ' Data output pin FUd VAR PortB.7 ' Frequency update output pin PortB = 0 TRISB = 0 ' All outputs Pause 1000 ' Let everything power up ' Tuning word for 500kHz = 500000*2^32/125000000 = 17179869 or, in HEX, $010624DD ' The AD9850 wants the least significant byte first: SHIFTOUT Dta, Clk, 0, [$DD, $24, $06, $01, $00] ' Now pulse the Frequency update pin FUd = 1 : PauseUS 10 : FUd = 0 ' Blink a LED to show we're alive. Done: Toggle PortB.3 Pause 100 Goto Done
/Henrik.




Bookmarks