I am trying to give the DAC output from one controller to ADC input of other controller. I am using Arduino Due board on both sides.
On DAC side I generated Sine wave at 50Hz which is phase shifted using a lookup table.
Now I want to give this analog signal to ADC input of other controller and I expected to get almost same values on ADC which I fed in the lookup table to DAC as both the boards are same and have same frequency, sampling rate and resolution as well.
But the values are not following the trend and I was expecting that the output from ADC might vary in amplitude i.e. its amplitude might be either greater or smaller than the reference sine wave((which I gave to ADC). But the objective is not achieved.
I am attaching below the excel sheet where I have plotted the values fed to DAC and the values outputted from ADC. the graph is made as well.
In the graph I have done the difference between the values from DAC and ADC, it is following a sinusoidal trend as depicted in second graph.
Please guide through it.
Several points can explain the difference between look-up table/Dac output/ ADC conversions:
1/ The DACs output a voltage betwwen 1/5 * 3.3V and 5/6 * 3.3V (see datasheet, electrical characteristics). You want to add some hardware to correct this first point:
2/ For ADC conversions, you may need a calibration to get more accurate values.
Atmel Application Note Analog-to-Digital Converter in the SAM3S4 details everything you need to make this calibration.
3/ Search in the DUE sub forum for hints to apply when you are doing ADC conversions, e.g. do not power the board with the USB cable (too unstable), select an ADC channel dedicated as a purging input. Connect it to ground through a small resistor and sample that channel in between each channel you are interested in. etc....
Furthermore, you didn't post your code.....maybe there's something wrong with it.