MPXA4115A picbasic code


Closed Thread
Results 1 to 40 of 104

Hybrid View

  1. #1
    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

  2. #2
    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!


    .

  3. #3
    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 " !!!
    *****************************************

  4. #4
    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...

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


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by bitmaniac View Post

    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...
    Hi, Alexandros

    I think the best way for the lookup table is :

    1) @ first ... take, say 200 or 250 points to calculate with the Excel Sheet ... ( just copy the formula by selecting the lines where to copy ... )

    2) compare results by taking exact 50 points, and linear approx between those points and the exact 200 points you've already calculated .... notice 50 give more precision than required ... ( lol )

    3) Take 32 points and idem 2) ...

    4) Stop when satisfied ( 32 might be comfortable for 0 -3000 m range)

    Do you really think an external EEPROM is needed ??? ... The LOOKUP command stores data in the ... Program memory !!! ( as " retlw xx " lines )


    Now, I think XL sheet gives meters too ... no ???

    On my side I shall write an XL sheet for that purpose ... might be handy one day ...

    Good Evening
    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Thumbs up

    Hi! Alain

    Sorry my friend but I hav not completely followed your idea.
    Do you mean sth like the attachment one?

    (ie: I have to 'expand' the range 200 , 50 and 32 'between' 0 - 3000 m I want to calculate?)

    I have to follow your idea, so help me out , as I can see you have a point here!
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    Hi, Alexandros

    As a good drawing is worth ...

    see this XL sheet ...

    shows how things go on ...

    And Overall shows a differential amplifier is needed between Sensor and ADC, to get a good resolution ( see the very, very limited ADC result range ... if direct connexion ).

    Note @ sea level the 300 m altitude is less than .1 v change @ sensor Output. Not that good for noise impact on signal ...

    also note the mean value for altitude meters vs pressure change is precise enough for our use and so, we can consider it only depends on reference pressure @ ground level ... or even, that variation is linear ...

    From the datasheets, It looks the ADC ref ( V+ref - V-ref ) must be, at least 3 v ... no hope from the Vref- side.


    Another way could be to use the MS 5534 Intersema sensor, a NUMERIC output sensor whose resolution is ... 15 bits. Paying attention to noise would be cancelled too ...

    Note particular calibration data from factory is included in the chip memory ... so, no further calibration would be needed ...

    For the moment, I let you play with the calc sheet ...

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

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