And this 65472, isn't the 1023 with left justification?
Ioannis
And this 65472, isn't the 1023 with left justification?
Ioannis
At page 157 of the Data sheet, it is shown that the PIC defaults to ADFM at 0 (zero), so it is really Left Justified by default. You have to make it a 1 for Right Justified result.
The register is the ADCON2 and bit 7.
Ioannis
Yes, because you have the freaking thing configured wrong for the way that ADCIN works for crying out loud :-)Just for grins I took a 10K resistor and fed the A/D input pin with 5 volts. The reading I got was 65472!
Just set the justification bit correct, as Ioannis shows AND as we've already discussed in the other thread where we went thru all this resolution and justification stuff last time.
OK, so it's a 0.07psi and not 7psi as I based my code around..... Well, then we need to change the scaling but lets see if it works at all first.
/Henrik.
that works out pretty nicely every adc 100 count is almost exactly .01 psi
0=110 , 0.07 = 820 couldn't be easier
assuming I read the data sheet properly and that 0.07 psi = 4.0 volts and vref=5 v of course
Last edited by richard; - 25th November 2014 at 06:49. Reason: still can'y type
Not quite Richard. In theory
0=102.4 at 0.5 volts and 0.07=921.6 at 4.5 volts.
assuming as you say the vref=5 v.
102.4 is the zero offset and 0.07/(921.6-102.4) is the slope.
to convert to psi
psi=(reading-offset)*slope
psi=(reading-102.4)*0.07/819.2
psi=(reading-102.4)*0.0000854492.....
I do seem to remember this is for a depth gauge on a model submarine and am wondering what depth of water is 0.07 psi. The answer is 100 mm of water (99.54mm).
Giving
mm of water=(reading-102.4)*0.12207028.....
just to check at maximum reading = 921.6
therefore
mm of water=(921.6-102.4)*0.12207028
mm of water=99.9999
I am now wondering if this gauge is suitable?
Steve Earl www.datageo.co.uk
0.07 psi gauge surely is a differential one ... so, one could reasonnably think it's for measuring SPEED with a pitot tube ...
just my two cents ...
Hi, Ed
Why not download that jewel ???
http://curveexpert.software.informer...nload/?ca13e51
Alain
Last edited by Acetronics2; - 25th November 2014 at 20:49.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi!So if I understand correctly I need to use ADCON2 instead of ADCON1 with the same bit configuation? Yes Alian your are completely correct! It is a differntial sensor for my submarine. As the sub dives you need to subtract out the pressure at a given depth for the incoming pressure to stay meaningful.
Bookmarks