MPXA4115A picbasic code


Closed Thread
Results 1 to 40 of 104

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    .....I can see your 470pf.... over there... yes there.....next to your Pickit2 he!he!

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


    Did you find this post helpful? Yes | No

    Default

    3d visualization of a test pcb attached...

    As you notice I didn't care much about the placement of sensor caps.
    Just wanted to see the size of the board and best placement of connectors

    (pcb measured... 45mm X 30 mm)

    PLEASE NOTE all connectors will be male (not as seen) except for the sensor that it will be soldered on board
    The sensor will be layed above C3 C2 and C1 (low profile cap)
    Attached Images Attached Images  
    Last edited by bitmaniac; - 5th June 2009 at 11:47.

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


    Did you find this post helpful? Yes | No

    Talking 1st try :SUCCESS

    SUCCESS!

    Scalerobotics your code worked ok.

    I put together a 12f675 , two caps on MPX supply pins , one 100n on pic supply pin one resistor to PC serial RX port and guess....

    I get 54-55m ALT here from our MPX4115 project on the desk.

    I also turned on my other project with a gps module next to it and I get 54-58m ALT!

    PERFECT right on the SPOT!!! I am very please with the result.

    May be we must also include a calibration initial setup.

    pic settings 4Mhz internal , Clk source Fosc/8 , Define ADC clock 2 (I will try 1 later) and ADC_SAMPLEUS 5.

    The only thing left to verify is the accuracy in meters.

    I am very happy now!

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    First try success? Nice!

    Maybe you are already converting feet to meters in your code, but this seems to work for me. And I think it is better than a new metric lookup table, because there are more feet per increment, which should make it more accurate.

    Code:
        if metric = 1 then   'convert from feet to meters
            finalALT = finalalt * 2500
            finalALT = div32 8203
        endif
    So it looks like you are making an altitude hold circuit. An altitude hold has been on my back burner for a few years now. Darrel's code has really made part of this easy, so it looks like I may be able to move this up a burner or two myself!

    How smooth is your servo at 4 mhz and 8 mhz? I would think that 20 mhz would be a bit smoother for sensing pulse width, but have not tried the lower mhz.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    Altitude hold : oh! you gave me another idea!

    For the moment it will be an ALT+TIMER motor cut-out for moto-gliders for F5J-GR . I am trying to make a circuit that will cut motor after 30sec or to an ALT of 200m what comes first!

    about your question I think we will have problems with internal 4mhz. I am thinking of going to 12f683 (8 Mhz internal) and more code space , we are in the limit here with f675. Also may be asm is used to pass servo pulses through and/or maybe as final solution we will go to an external low profile crystal and two decopuling caps.

    I will experiment and see....

    (Now I get 51m here (project running!) the funny thing is that I have closed the door of my lab now , the weather got very hot here now . I think there will be no problem with the calibration because the only think I want to measure is ALT differece of 200m so 1st you have to power the device just 1minutes before flight. It will read the ground alt and if 200m reached motor will cut that's all.
    Last edited by bitmaniac; - 5th June 2009 at 17:18.

  6. #6
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Modified the code to handle 0 to 25,900 feet, and a 16 bit conversion lookup table. Now you can select your conversion oversampling rate for Darrel's code, and your result gets shifted to match the 16 bit lookup table for altitude conversion. Works for 10 to 16 bit oversampling rates. My favorite is the 15 bit for accuracy and speed, but it is selectable.

    See http://sites.picbasic.net/component/...,91/pageid,81/ for more info.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    scalerobotics , you have done excellent work again my friend!.

    But you made me wonder ... (as I have already design the pcb of my ALTMTR) MUST I include a Crystal (20Mhz) after all or I can leave/ and rely on internal 8Mhz oscillator (12f683) with any drawbakcs of it?
    May be I need to redesign my mcb and loose button activation option.
    Or may be I use led indication both as input and / or output this will make me think.... )

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