1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

PIC plus-5110 LCD-GPS-BMP280-HMC5983

Discussion in 'Oshonsoft' started by camerart, Mar 12, 2017.

  1. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,823
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    Ok.
    Did you look at my jpg?

    EDIT: If x_raw > 32767 'needs a' Then


    C
     
    Last edited: Mar 1, 2018
  2. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    389
    Likes:
    18
    Location:
    Helsinki, Finland
    Yes,
    x_raw.hb = b(0) is ok
     
  3. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,823
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    Thanks, all changed.
    I'm not getting any READings, and wondering if SPI can't be used. (I think Eric explained it earlier)

    EDIT: Just spotted that one of my SPI leads has come off the PCB PIN:( I don't know how long this happened.

    C
     
    Last edited: Mar 1, 2018
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  5. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,823
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    I've tested your routine and it works as expected, it's much better programming. I've removed BIT17H.

    I'm sure along the way, I've had results, where I moved the compass module, and the numbers changed. I've either broken it, and need to recheck old programs, or buy some different modules.
    Thanks C.
     
  6. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,823
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    I'm getting good results (I think) There's no calculation yet, I think the results are in radians. (incorrect)
    I'm getting a problem where I get switching between sensible readings, to all zeros. I've tried SPICLOCK_STRETCH, which may be making a difference, but not curing it. Can anyone shed light on this please?

    See attached, two 5110 images, showing XZY registers +B register + mode settings.

    EDIT:
    I've also tried disabling the OSCTUNE.PLLEN = 1 '*4 PLL enabled so Fosc = 32MHZ, but no difference.
    Also, tried, 'when showing all zeros' switching off/on and reprogramming, but it still shows zeros.

    I have a LED flash which shows the MAIN LOOP is being looped.
    C.
     

    Attached Files:

    Last edited: Mar 6, 2018
  7. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    389
    Likes:
    18
    Location:
    Helsinki, Finland
    The results are not radians, they are the x,y components of the magnetic field.
    You get the angles with arctan function from x and y, see the other thread.
     
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  9. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,823
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    Thanks, corrected.
    C
     
  10. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,823
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    Since post #545 I tried running a logic analyser on the Compass to PIC leads, while the 5110 is showing zeros. It shows the Compass is sending results ok.
    C.
     

    Attached Files:

    • Log.txt
      File size:
      5.6 KB
      Views:
      1

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice