• 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

camerart

Active Member
Thread starter #561
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:

camerart

Active Member
Thread starter #563
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:

camerart

Active Member
Thread starter #564
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.
 

camerart

Active Member
Thread starter #565
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

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.
 

camerart

Active Member
Thread starter #568
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

Latest threads

EE World Online Articles

Loading

 
Top