can u help me out in this projct i am doing the samr thing but my wave form is one side sine and other is straight at 2k freq. i am giving input from function generator and in future i want to give audio input. thanks
I copied your software above and uploaded it to my Due. Next I set my signal generator to output a DC sine wave 0 - 2Vp-p 1 kHz. I am not sure the Due can handle a true sine wave going negative. I then plugged the + signal generator into the A0 pin and the ground into one of the ground pins. Next, I hooked up my oscilloscope to the DAC0 pin with the ground going to one of the ground pins. Output was only noise. What is wrong?
My error and it appears to work okay. What I did notice is that the Due's accurate voltage output is limited to about 700mV p-p with a frequency around 1kHz max. For real work need to have a much faster processor so I am moving to a Cortex M7. The voltage out is totally inaccurate but the frequency is okay.
That is correct. To measure your sinewave you would need a DC offset for your AC sine wave. You could center the DC offest at the midpoint threshold of the ADC pin, and see the maxium amount of voltage swing around the midpoint. By "level shifting" the sinwave you can see the "negative" swing realtive to the midpoint and not ground (0V).