Hello friends,
Thank you so much for quick and positive response to all of the members.
After commenting the following lines, the adc program is using
approximation method.
if(buffer[i] != 0xFF)
virgin = FALSE;
Also I have understood the working of ADC from page no 33 of
EP9301_PP5.pdf. From the diagram it is clear that the Digital value
will be ranging from 9E58 to FFFF and 0000 to 61A8 total of 50k counts
which will map 0 to 3.3 volts.
I have few questions ::
1) Now without giving any input voltage the output using approximation
method as shown below. How the program is giving 1.665 count when the
input value is 0 voltage ?
No calibration values found...
Channel 0: 1.665V
Channel 1: 1.665V
Channel 2: 1.665V
Channel 3: 1.665V
Channel 4: 1.665V
2) Now when i apply constant voltage of 1.5 volt on pin no 4 of DIO1
Header. and then i ran the program i find the different outputs values
on every execution even when the applied voltages are same ?
Here is the outputs Both for 1.5 Volt & same current
A)
No calibration values found...
Channel 0: 2.641V
Channel 1: 1.670V
Channel 2: 1.665V
Channel 3: 1.665V
Channel 4: 1.665V
B) No calibration values found...
Channel 0: 0.319V
Channel 1: 1.665V
Channel 2: 1.665V
Channel 3: 1.665V
Channel 4: 1.665V
Any kind of suggetions are highly appreciated ..
Thank You..
Ankur.
Have a Nice time and good day ahead..
I am not using
--- In Eddie Dawydiuk <> wrote:
>
> Hello,
>
> > I tried to run the sample code at http://www.pastecode.com/14646 which
> > is lastly updated as of Apr 29, 2005 and found the following output.
> >
> > Calibration Values =
> > [ 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 ]
> > Board has been calibrated by Technologic Systems...
> > Channel 0: 2.509V
> > Channel 1: 2.509V
> > Channel 2: 2.509V
> > Channel 3: 2.509V
> > Channel 4: 2.509V
> >
> > Now i have few questions regarding the code ::
> >
> > 1) why the output shows 0x0 calibration values as according to
> > http://tech.groups.yahoo.com/group/ts-7000/message/934
> > there should be any data ?
>
> I'm not sure what version of the code this is, I'd recommend downloading
> the code in the files section to ensure we are talking about the same
> code... Unless otherwise programmed an e2 has 0xff at every location.
> The code therefore assumes if it reads any value other than 0xff
> at CALIB_LOC in the e2 that the board has been calibrated and assumes
> the values read are the calibration values. 0x00 is not a valid
> calibration value. Please download the code from the files section,
> if you are still seeing calibration values of 0x00 it is possible you
> e2 was overwritten and therefore the assumption the code makes is
> invalid. If this is the case simply comment out the following lines
>
> //check if board has stored calibration values
> if(buffer[i] != 0xFF)
> virgin = FALSE;
>
> > 2) In the code, why 0x10000 is being added in the following statement
> > or if one can eloborate the meaning please (Line No. 181)
> > (((((double)(stored_cal[i][1] + 0x10000) - stored_cal[i][0]) / 2.5
> > ) * 3.3 ));
>
> The onboard ADC returns a 16 bit signed value corresponding to the
> voltage. You'll need to first look at the EP9301 datasheet to get
> documentation on 16 bit signed value and the corresponding voltage.
>
> It's on page 33
http://www.cirrus.com/en/pubs/proDatasheet/EP9301_PP5.pdf
>
> But to answer your question the code translates the signed return value
> to an unsigned value.
>
> > 3) Also why the following statement is included? (Line No. 190)
> > if(avg < 0x7000) avg = avg + 0x10000;
>
> See above.
>
> > 4) In the code, #define CALIB_LOC 2027 is used for location of
> > calibration values but according to ts-manual-rev2.2.pdf
> > on page 28 the location is defined as 0x07EB through 0x07FE that
> > holds the calibration values, so how the mapping is
> > done ? (Line No. 14)
>
> Decimal 2027 == Hex 0x7EB.
>
> //Eddie
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Great things are happening at Yahoo! Groups. See the new email design.
http://us.click.yahoo.com/lOt0.A/hOaOAA/yQLSAA/CFFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|