AD9850 Generate Random Fixed Frequencies Controlled By MEGA328P-AU

Hey

I’ve made a circuit with AD9850 Controlled by ATMega328P-AU with serial interface.

Here is the Schematic Link.

https://gofile.io/d/ShIaPi

I’ve Tested Prog with AD9850 Module (HC-SR08_Module) and code is working.

Circuit use a 3.7v Single Cell Li-Po Battery and MT3608 to Boost 3.7v to 5v.

The Reference Oscillator for ad9850 is 2 MHz .

I’ve Reduce the code to just set the frequency of ad9850 But it generates few fixed random frequencies .

for instance:

Desire Freq ----> Output Freq

1 KHz ----> 900 KHz

2 KHz ----> 3.9 KHz

3 KHz ----> 15Hz

4 KHz ----> below 2Hz

5 KHz ----> 899 KHz

and so on…

every time i change frequency , the output frequency is a random value between above.

I would appreciate any help.