Continue to Site

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.

  • 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.

PIC plus-5110 LCD-GPS-BMP280-HMC5983

Status
Not open for further replies.
The syntax error:
x raw = should be x_raw =
Long is not needed when x_raw = 65535 - x_raw
better use x_raw = Not x_raw
then no need to remember magic numbers.

Singles are needed, when you calculate angles from x,y, unless you have arctan function using integers.
Hi J,
Ok.
Did you look at my jpg?

EDIT: If x_raw > 32767 'needs a' Then


C
 
Last edited:
Yes,
x_raw.hb = b(0) is ok
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:
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.
 
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.
 

Attachments

  • 1.jpg
    1.jpg
    135.4 KB · Views: 332
  • 2.jpg
    2.jpg
    152.3 KB · Views: 310
  • MAIN LOOP.txt
    2.3 KB · Views: 319
Last edited:
Hi,
I'm getting good results (I think) There's no calculation yet, I think the results are in radians.
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.
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.
 
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.
 

Attachments

  • Log.txt
    5.6 KB · Views: 309
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top