Fratello,
The result should be in mVolts.
Fratello,
The result should be in mVolts.
Last edited by rsocor01; - 12th November 2010 at 16:36. Reason: Incorrect statement
"No one is completely worthless. They can always serve as a bad example."
Anonymous
You almost had it right Fratello.
And the timing will be more accurate if you don't do the math on each loop.
Code:vmax = 0 for cnt=1 to 70 adcin 3, v_cal vmax=vmax max v_cal pause 100 next cnt v_cal=vmax * 5000 ' I use VDD as Vref v_cal=div32 1023
DT
Thank You all for reply !
Both variant (mine = 0 max v_cal and variant of Mr.Robert ) give me the same results : 24 .
According of my math, I think this is the value of 24 mVolts. I am right ?
Now I try the variant of Mr.Darrel (remember ? My guardian angel in PBP problems...).
I post the results.
LE : Something strange...with this variant, I read only 5 mV ?!
Maybe the schematic help...
Last edited by fratello; - 12th November 2010 at 16:16. Reason: schematic added
Oops, disregard my comment. Yes, you should get your result in millivolts.
Robert
"No one is completely worthless. They can always serve as a bad example."
Anonymous
Tested and re-tested today both variant : Mr.Darrel's and Mr.Aratti.
Still different results : 5mV vs. 24 mV. It's so strange for me...
fratello,
I'm not sure what you've done in your code, but I've tested it here and it works.
<object id='stUkhdQ01IR1FWRltYU1tYUVNR' width='425' height='344' type='application/x-shockwave-flash' data='http://www.screentoaster.com/swf/STPlayer.swf' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0'><param name='movie' value='http://www.screentoaster.com/swf/STPlayer.swf'/><param name='allowFullScreen' value='true'/><param name='allowScriptAccess' value='always'/><param name='flashvars' value='video=stUkhdQ01IR1FWRltYU1tYUVNR'/></object>
DT
Wow, Thank You again Mr.Darrel !
Maybe my code it's wrong ; I use
insteadCode:DEFINE OSC 4 DEFINE ADC_BITS 10 DEFINE ADC_CLOCK 3 DEFINE ADC_SAMPLEUS 50
This is the explanation, don't ?Code:DEFINE ADC_BITS 10 ' ADCIN resolution (Bits) DEFINE ADC_CLOCK 1 ' ADC clock source (Fosc/8) DEFINE ADC_SAMPLEUS 11 ' ADC sampling time (uSec)
NO, I think this is NOT the explanation ! My math teacher it's verry, verry angry...
I learn more here : http://www.darreltaylor.com/DT_Analog/
1 step=0.0048875. So, if I have Max_result 450, Volts= 450 * 0.0048875 =2.199 Volts; for 696 --> Volts= 696 * 0.0048875 =3.401 Volts...
Stupid me, again![]()
Last edited by fratello; - 13th November 2010 at 16:54.
Bookmarks