MPXA4115A picbasic code


Closed Thread
Results 1 to 40 of 104

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Gosh ...

    One more manufacturer ( Linear ) in error ?? ...



    But here ... he shows output number vs input voltage


    look at this joined piece of datasheet ...

    Code "1023" is NOT corresponding to Vref ... but Vref MINUS one LSB ...

    so ... Vref corresponds to code "1024" !!! and there are 1024 steps, the "1024" value never being displayed ...

    May be the explanation is here ...

    Alain
    Attached Images Attached Images
    Last edited by Acetronics2; - 17th May 2009 at 12:30.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Well, in this instance ADCMAX is correct because VREF is never attainable.

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Mel

    ...

    and I do think it's the same for all the manufacturers ...

    just have a look to µChip AN 544d ... or the Midrange Manual ... they all show code $3FF for 1023 LSB ... not Vref , which is 1024 x LSB ! ( see § 23.12 )

    Would be interesting to verify which input voltage give code 255 for a 2.56v ref ( quite simple !) , ... give code 4095 for a 4.096 v Vref ( less simple ), etc, etc.

    don't you think ???

    Regards
    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    I agree with Melanie.

    Let's forget about what the overpaid engineers and datasheets have said, and look at it from purely a results perspective.

    With 10-bit A/D the resulting values go from 0 - 1023.
    If Vref=5.00V and you apply 5.00 volts to the A/D you get a reading of 1023.

    If you then use 1024 as the Vref divisor, the formula to calc the Voltage from the A/D reading would be ...

    5.00/1024 * 1023 = 4.99 ; Not the 5V we were looking for.

    But if you use 1023 ...

    5.00/1023 * 1023 = 5.00 ; this is what I want it to read.
      Notice how the (/1023 * 1023) cancels out.

    In the context of this thread, the results are similar.
    If the manufacturer states a pressure of 115kPa at 4.7V ... using 1024 with a 4.7V input, you will only read 114.xxkPa, again not the reading we wanted.

    So for this (and any other analog projects), I'll continue using the maximum ADC value for the divisor (255, 1023, 4095).
    <br>
    DT

  5. #5
    Join Date
    Jan 2004
    Location
    Thessaloniki , GREECE
    Posts
    61


    Did you find this post helpful? Yes | No

    Smile

    Hi Darrel ,
    hi Acetronics (It's me bitmaniac from rcgroups -navlights)

    I am in the progress of developing my own ALT timer for F5J category
    I want to deactivate/arm a mechanism at 300m for example.

    I am using MPX4115A a max187 (12bit) and a pic to read altitute.

    thought #1: I wonder if I can use an eeprom to store look up table of all alt values you can meat here in Greece (0m to 3000m max) and not use extensive calculation to determine alt.

    thought #2: Also I am thinking of just usin ground kPa - specific height kpa and the difference (in kPa) gives me the heigth I want to calculate.

    Are my thoughts correct or I miss something?!!

    Thank you for your time my friends!


    .

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Alexandros

    Nice to hear from you !!!

    Good choice for sensor and ADC ... also think to MPX 6115 and LTC 1286 , that also are good choices ...

    for the tow release mechanism, no big soucy. just think the Zeroing command will be used very often, so it must be really handy ...

    lookup tables will be the simplest solution, linear approx between two table values will be enough, as the goal is not to reach EXACT altitude, but everyone being released at the SAME altitude ...

    Also think the pressure value will need some smoothing: if some air intake in the nose of the gliders ... measure will be false if no mean value calculated.

    I join you a small handy tool to create the lookup table ...

    Read you soon
    Alain

    PS: AZLights have been also seen aboard jet models ... ( a nice "Rafale", between others ... )
    Attached Files Attached Files
    ************************************************** ***********************
    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 " !!!
    *****************************************

  7. #7
    Join Date
    Jan 2004
    Location
    Thessaloniki , GREECE
    Posts
    61


    Did you find this post helpful? Yes | No

    Default

    hi Alain how are you my friend pleased to here from you again...

    In our point now...
    Well I will stick to MPX41154 and max 187 already ordered.
    I am in the proccess of making/simulating the pcb.

    Well I think will follow the table lookup method (although there will be one more chip (eeprom) in the pcb) but I have first to solve the equation you send to calculate meters instead of milibars.
    ..and better to kPa and not milibars.

    I will let you know of my progress...

Similar Threads

  1. sample code for AT45DB642D in Picbasic Pro
    By itsssyam in forum General
    Replies: 0
    Last Post: - 10th March 2010, 06:01
  2. 16f887 44 pin demo board code problem?
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th December 2008, 14:17
  3. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 18:31
  4. PicBasic code problems with a 16F84A
    By Lauren Barta in forum mel PIC BASIC
    Replies: 3
    Last Post: - 30th May 2006, 22:50
  5. PicBasic Fundamentals
    By Billyc in forum General
    Replies: 9
    Last Post: - 4th May 2004, 10:04

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