I'm feeling quite pleased with myself, my AD9850 controller is working but for a couple of issues. I think if I crack this one I might get the solution to the other one.
So, you enter the desired frequency, and press enter, which calculates the tuning word and writes it out to the DDS. The chip is set to startup in serial mode as per the datasheet.
But...
When the program starts, it sets a default frequency for the chip, and runs the "enter" routine as though the key had been pressed... but nothing happens... until the physical enter key is pressed.
Here's the relevant bit of code:
(NB, "GO_" prefixes routines that have jumps at the top of their page)
Code:
START
call CLR_BCD ; clear the BCD
bsf BCD+1,2 ; start with value of 400
; SET UP DISPLAY, TIMER AND PORTS IN HERE - DELETED FOR CLARITY
call GO_DISPLAY ; set up and display the default value
bcf W_CLK ; AD9850 control pins
bcf D7
bcf FQ_UP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DEBUG
movlw 1
pscall FLASHY
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END DEBUG
pscall GO_ENTER ; function is normally run by pressing the enter key
I think I need to add some extra actions before calling GO_ENTER - I've tried resetting the chip, setting and clearing FQ_UP and probably other things I've forgotten. So now I'm stumped.