ahsoopk
Member level 5
- Joined
- Mar 12, 2010
- Messages
- 81
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 2,103
Hi all,
Thanks for taking time to look at my post. I am trying to control AD9850 DDS module using pic18f4520 using C18 and MPLAB.
AD9850 takes in 40bit long serial tuning word and formula to calculate the word is as follows
phase_delta= (Foutx2^32)/Clock_in
I am using 125MHz clock to generate 30MHz Fout. I am initializing the phase_delta, Fout and Clock_in as Floating point varaibles, and watching the variable in MPLAB's watch window. But I get some garbage values, not sure what are those.
Secondly even I consider that garbage value as my result I want to send it bit by bit to the AD9850 chip, so I want to perform bitwise AND operation between phase_delta value and predefined 32bit long mask and keep LEFT SHIFTING the mask to generate bit by bit data. Compiler doesn't let me do that either as it says Integer operands required for bitwise AND.
I am really stuck I am new to microcontroller/C business and would really appreciate if someone can help. If someone has done this themselves before than can they please take me through step by step if possible, otherwise hints and suggestions will be much appreciated.
Regards,
Thanks for taking time to look at my post. I am trying to control AD9850 DDS module using pic18f4520 using C18 and MPLAB.
AD9850 takes in 40bit long serial tuning word and formula to calculate the word is as follows
phase_delta= (Foutx2^32)/Clock_in
I am using 125MHz clock to generate 30MHz Fout. I am initializing the phase_delta, Fout and Clock_in as Floating point varaibles, and watching the variable in MPLAB's watch window. But I get some garbage values, not sure what are those.
Secondly even I consider that garbage value as my result I want to send it bit by bit to the AD9850 chip, so I want to perform bitwise AND operation between phase_delta value and predefined 32bit long mask and keep LEFT SHIFTING the mask to generate bit by bit data. Compiler doesn't let me do that either as it says Integer operands required for bitwise AND.
I am really stuck I am new to microcontroller/C business and would really appreciate if someone can help. If someone has done this themselves before than can they please take me through step by step if possible, otherwise hints and suggestions will be much appreciated.
Regards,