I am trying to generate sine wave using programmable waveform generator AD9833 with ATmega32-A micro controller.(MCLK =8MHz clock frequency). I am using USART communication and so if i change frequency or phase in hyper terminal then the waveform frequency and phase has to change. I wrote small code for this as shown below.
but from the above code I am generating sine wave. If i enter frequency then waveform frequency also changing exactly but i tried to change phase then here is the problem. If i enter phase as 90 then it is changing 10 degree it is not changing 90. I don't know why it is generating like that and what mistake I did? am i missing any bits ? problem with phase only.
Thanks in advance.
If i want enter float value of phase for example 2.5 degree, what i have to change. either "unsigned int phase" into "float phase" in the function. if i try like that the "<<" is not compatible with float.what i have to do if i want to enter phase as 35.8 degree. please suggest me.
Thanks in advance.