Read the PIC datasheet.
Use the internal clock of the PIC and set it to some sane Mhz value .. for example 1 Mhz or 4 Mhz. With PIC microcontrollers, everything works in sets of 4 cycles. Most instructions need 4 Hz to finish, some instructions need 2 x 4 Hz to finish. So at best, with 1 Mhz clock you have 250k instructions per second or 250 per ms or 2.5 per ns. With 4 Mhz, you have 1 million instructions per second or about 1000 per ms or 1 per nanosecond.
By default, I think the PIC will stay at 31 Khz and that's superslow. Just setting those RB3 and RB4 will take maybe a 10th of a second.
If i got it right the clk needed = 3.5 ns (min)
And FQ = 7.0 ns. (min)
hex=075F6FD2 (3.6MHz)
hex=075F6FD2 (3.6MHz) is incorrect.
To put a binary value in a variable, you say binarynumber =
0b10101010;
To put a hexadecimal value in a variable, you say hex =
0x075F6FD2;
Since you're working with a 8 bit microcontroller, it may be easier for you to store that frequency as 4 separate bytes: hex1 = 0x07; hex2 = 0x5F; hex3 = 0x67; hex4 = 0xD2;
You can then write these into a .h file attached to your project, and then just use the function names to get a bit from the each byte:
#define bit_get(var,bitno) ((var) & (1 << (bitno)))
#define bit_set(var,bitno) ((var) |= 1 << (bitno))
#define bit_clear(var,bitno) ((var) &= ~(1 << (bitno)))
ex PORTBbits.RB4 = bit_get(hex1,0); <--- put on RB4 the first bit of hex1.
PORTBbits.RBx where x = 0 to 7 set the pins of the PORT B to 0 or 1 .. they're BITS. You can only put 0 or 1 there. Can't assign a number like the whole frequency. You have to put one bit at a time, set the clock bit on and then off so that the dds takes the bit inside, then continue with the next bit. You basically have to send 32 bits, one at a time.
Now here you have to remember those " clk needed = 3.5 ns (min) And FQ = 7.0 ns. (min) " - if your clock is 4 mhz or something like that, when you put 1 on one of those .RBx variables, you have to keep in mind each of those instructions may take less than 1-2 ns, so you may want to add some delays there to give the other chip time to process what you send to it.
You can add in the same .h file some helper functions like these:
#define delay_1tcy() asm("nop")
#define delay_2tcy() asm("goto $+1")
so when you say in your code delay_1tcy(); the pic will waste one instruction doing nothing. Again, at 4 Mhz, that's 1 megainstructions per second or 1000 per ms or 1 per ns. So the PIC waits for 1 ns.
If you have to make sure you wait at least 3.5ns, then add delay_2tcy(); twice.
Same for the 7ns minimum.
--
If this is too confusing, you should probably start with a simple blink led example code and move from there.
I suggest at least browsing through these documents:
MPLAB® XC8 Getting Started Guide :
http://ww1.microchip.com/downloads/en/DeviceDoc/50002173A.pdfMPLAB® XC8 C Compiler User’s Guide :
http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB_XC8_C_Compiler_User_Guide.pdf