MPXA4115A ADC vref set_up


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default

    Darrel,
    thanks for the reply.
    I do have to apologize for my own error.

    I will like another couple of questions if I am not so tedious:
    How to set the clock conversion ADCS0 through ADCS2 bits ?
    The ADresult change if I set Fosc/2 : what is the correct one ?

    I have two sensors MPXA4115A in my hands now: is it reasonable to have a difference of 8 mBar between the two ? What is your experience ?

    Thanks a lot for the assistance
    Your is a great help .
    regards,
    Ambrogio
    Italy

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The idea is to get Tad (1 period of the A/D clock) as close to 1.6uS as possible (without going under). Which gives 625,000hz to the converter.

    For a main oscillator of 40Mhz ...
    take 40,000,000 / 625,000 = 64. So FOSC/64 is the proper selection @ 40Mhz.

    @ 24Mhz ... 24,000,000 / 625,000 = 38.4
    38.4 is between 32 and 64, so you take the highest of the two numbers, and at 24Mhz you also need FOSC/64.

    So that you don't have to calculate it each time, here's a table I made of the recommended settings for most oscillator frequencies.

    If using PBP's ADCIN statement, just use the highlighted numbers in the DEFINE ADC_CLOCK statement in your program.
    If manipulating the A/D converter manually, you'll need to encode the number into the ADCONx registers which varies between PIC families.

    <table cellspacing="1" cellpadding="3" border="1"> <thead> <tr> <th scope="col" align="center">OSC</th> <th scope="col" align="center">DEFINE ADC_CLOCK</th> <th scope="col" align="center">Clk source</th> <th scope="col" align="center">Tad (µs)</th> <th scope="col" align="center">12 Tad (µs)</th> </tr> </thead> <tbody> <tr> <th style="text-align: center">4</th> <th style="text-align: center"><span style="color: #ff6600">1</span></th> <th style="text-align: center">Fosc/8</th> <th style="text-align: center">2</th> <th style="text-align: center">24</th> </tr> <tr> <th style="text-align: center">8</th> <th style="text-align: center"><span style="color: #ff6600">5 / 2 </span><sup><span>(2)</span></sup></th> <th style="text-align: center">Fosc/16</th> <th style="text-align: center">2 / 4</th> <th style="text-align: center">24 / 48</th> </tr> <tr> <th style="text-align: center">10</th> <th style="text-align: center"><span style="color: #ff6600"><span style="color: #ff6600">5 / 2 </span><sup><span><font color="#000000">(2)</font></span></sup></span></th> <th style="text-align: center">Fosc/16</th> <th style="text-align: center">1.6 / 3.2</th> <th style="text-align: center">19.2 / 38.4</th> </tr> <tr> <th style="text-align: center">12</th> <th style="text-align: center"><span style="color: #ff6600">2</span></th> <th style="text-align: center">Fosc/32</th> <th style="text-align: center">2.6</th> <th style="text-align: center">31.2</th> </tr> <tr> <th style="text-align: center">16</th> <th style="text-align: center"><span style="color: #ff6600">2</span></th> <th style="text-align: center">Fosc/32</th> <th style="text-align: center">2</th> <th style="text-align: center">24</th> </tr> <tr> <th style="text-align: center">20</th> <th style="text-align: center"><span style="color: #ff6600">2</span></th> <th style="text-align: center">Fosc/32</th> <th style="text-align: center">1.6</th> <th style="text-align: center">19.2</th> </tr> <tr> <td style="text-align: center">24</td> <td style="text-align: center"><span style="color: #ff0000">6</span></td> <td style="text-align: center">Fosc/64</td> <td style="text-align: center">2.6</td> <td style="text-align: center">31.2</td> </tr> <tr> <td style="text-align: center">32</td> <td style="text-align: center"><span style="color: #ff0000">6</span></td> <td style="text-align: center">Fosc/64</td> <td style="text-align: center">2</td> <td style="text-align: center">24</td> </tr> <tr> <td style="text-align: center">40</td> <td style="text-align: center"><span style="color: #ff0000">6</span></td> <td style="text-align: center">Fosc/64</td> <td style="text-align: center">1.6</td> <td style="text-align: center">19.2</td> </tr> <tr> <td style="text-align: center">48</td> <td style="text-align: center"><span style="color: #ff0000">3</span></td> <td style="text-align: center">FRC</td> <td style="text-align: center">~4</td> <td style="text-align: center">~48us</td> </tr> <tr> <td colspan="5" style="text-align: left"><sup>(2)</sup> Most <span style="font-size: 12px">16F's don't have Fosc/16 (<span style="font-size: 12px"><span style="color: #ff6600">5</span></span>). Use Fosc/32 (<span style="font-size: 12px"><span style="color: #ff6600">2</span></span>) instead @ 8-10mhz</span></td> </tr> </tbody></table>
    It takes 12 Tad to complete 1 Analog to Digital conversion.

    I have two sensors MPXA4115A in my hands now: is it reasonable to have a difference of 8 mBar between the two ? What is your experience ?
    They have a maximum error of 1.5% full scale.
    The scale goes from 150 mBar to 1150 mBar or 1000mBar, and 1.5% of that is 15 mBar.

    So it sounds like yours are within tolerances.
    <br>
    DT

  3. #3
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel,
    thanks a lot for your usefull answers on the matter.
    That is great.
    regards,
    Ambrogio
    North Italy

Similar Threads

  1. Stable Adc Reading Routine
    By gebillpap in forum General
    Replies: 27
    Last Post: - 13th May 2015, 02:18
  2. ADC Vref
    By srob in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th April 2008, 18:07
  3. I2C Slave, config Vref - + in pic with ADC
    By sebapostigo in forum PBP Wish List
    Replies: 4
    Last Post: - 5th March 2007, 03:21
  4. Using VREF with 16F88
    By jpeakall in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th May 2005, 19:06
  5. 12F675 ADC 'Issues'
    By harrisondp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2005, 01:55

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts