What is the desired output from the dad test program?


8 posts
by ASindleMouat » Sun Dec 23, 2012 6:06 pm
Hi,

Does anyone know what the desired output looks like for the dad test program?

I fear I may have fried part of my board by removing the IC socket at U6 as I had soldered it in the wrong way round. Only now have I read this post http://www.raspberrypi.org/phpBB3/viewtopic.php?f=42&t=20379. :oops:

Thanks,

Andrew
Posts: 4
Joined: Thu Dec 20, 2012 1:21 pm
Location: Carlisle, UK
by alexeames » Sun Dec 23, 2012 8:02 pm
A triangular shape of # characters as the graphical output with two columns of numbers before it. Something like this...

Code: Select all
####
########
############
########
####


If you leave off the jumper between AD0 and DA1 you will just get the first column of numbers
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2079
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by ASindleMouat » Sun Dec 23, 2012 9:50 pm
Thanks Alex for the quick response, I will need to run it again when I get a chance tomorrow but I think it only produced the first column of what looked like hex numbers then the second column which looked like it should have been binary but it was all 0000. I don't think there was a third column.

I had also tried the dtoa program and I was not getting any reading from the multimeter, but I was not sure if I was using it right (I'm a noob with these tools). And I don't have any potentiometers to test the atod program.
Posts: 4
Joined: Thu Dec 20, 2012 1:21 pm
Location: Carlisle, UK
by alexeames » Sun Dec 23, 2012 11:02 pm
ASindleMouat wrote:Thanks Alex for the quick response, I will need to run it again when I get a chance tomorrow but I think it only produced the first column of what looked like hex numbers then the second column which looked like it should have been binary but it was all 0000. I don't think there was a third column.

I had also tried the dtoa program and I was not getting any reading from the multimeter, but I was not sure if I was using it right (I'm a noob with these tools). And I don't have any potentiometers to test the atod program.


Yes in the C version the first column is hex numbers. In the Python version it's base 10. The second column should be a base 10 number between 0 and 1023 (although it doesn't go all the way up to 1023).

Have you got all the jumpers on the correct ports? You need them on 11, 10, 9, 8 & 7 to their corresponding SCLX,MOSI,MISO,CSnA & CSnD otherwise the A to D and D to A converter chips aren't connected to the SPI bus.
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2079
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by ASindleMouat » Mon Dec 24, 2012 9:05 am
Oh dear I think I might have found the problem! Rookie mistake, I missed a jumper on 7 :oops:

Thanks very much for your help Alex.
Posts: 4
Joined: Thu Dec 20, 2012 1:21 pm
Location: Carlisle, UK
by alexeames » Mon Dec 24, 2012 9:26 am
ASindleMouat wrote:Oh dear I think I might have found the problem! Rookie mistake, I missed a jumper on 7 :oops:

Thanks very much for your help Alex.


You're welcome.
That's a much better outcome than having damaged the board. :)
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2079
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by tobes » Thu Dec 27, 2012 8:12 pm
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...
Posts: 3
Joined: Thu Dec 27, 2012 8:05 pm
by alexeames » Thu Dec 27, 2012 9:01 pm
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
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2079
Joined: Sat Mar 03, 2012 11:57 am
Location: UK