tobes wrote:Having successfully got the "Tree" display, I've noticed that the values read are only about 1/3 of the values written, this seems like an awfully large drop to me.
Is this typical, or should I investigate further? Even with the output only going up to 2v, and the input being relative to the 3.3v, I'd have expected "read" values to be more like 2/3 of the output...
The DAC is 8 bit hence the values written to it are from 0-255 (representing 0-2.048V)
The ADC is 10 bit, hence the potential values can go from 0-1023, but in reality, because we are using the DAC in (gain = 1) mode, the maximum voltage it can put out is not 3.3V, but 2.048V.
So if you write 255 to the DAC, you'll read 2.05 Volts, which will correspond to 2.05 / 3.3 * 1023 = 635
Also note if you are using the C version, column 1 is in hexadecimal