Programming PIC with GY-282 HMC5983 COMPASS

Thread Starter

camerart

Joined Feb 25, 2013
3,830
Hi,
I'm trying to add a GY-282 HMC5983 compass module to a PCB with 18f4431 PIC.
Has anyone used one of these modules? If so, can you give me some pointers for setting up the REGISTERS and testing it please?
Camerart.
 

takao21203

Joined Apr 28, 2012
3,702
Have you heard of Arduino; use the Arduino library.

Is same, C language.

They have libraries for most of the modules sold online.

You need to consultt datasheet to assist to convert the library to PIC.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
Have you heard of Arduino; use the Arduino library.

Is same, C language.

They have libraries for most of the modules sold online.

You need to consultt datasheet to assist to convert the library to PIC.
Hi T,
I've have Arduino on my system, but I can't 'speak' 'C' I'm afraid although I could probably understand the relevant parts, if you have a link you could post please. I use BASIC.
I'll have a look myself also.
I'm a bit stuck with the DATA sheet too.
Thanks.
EDIT: I downloaded an Arduino example, which looks pretty helpful.
C.
 
Last edited:

takao21203

Joined Apr 28, 2012
3,702
Hi T,
I've have Arduino on my system, but I can't 'speak' 'C' I'm afraid although I could probably understand the relevant parts, if you have a link you could post please. I use BASIC.
I'll have a look myself also.
I'm a bit stuck with the DATA sheet too.
Thanks.
EDIT: I downloaded an Arduino example, which looks pretty helpful.
C.
So you use Basic on the 18F? Is it preprogrammed and you upload Basic script or do you use the compiler?

I think most of these Arduino modules use the I2C, normally it should be provided in the BASIC environment too.

And also there might be code on a forum about PIC + Basic.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
So you use Basic on the 18F? Is it preprogrammed and you upload Basic script or do you use the compiler?

I think most of these Arduino modules use the I2C, normally it should be provided in the BASIC environment too.

And also there might be code on a forum about PIC + Basic.
Hi T,
Yes, I use the Oshonsoft simulator and compiler, and have done for a long time, which has a few restrictions, that with help I have got around up to now. In this case the D/S suggests 'burst READing' of the registers, but Oshonsoft can't do this (I think) so I am trying to READ each register individually.
I use SPI, as it appears superior to i2C to me.
I haven't found any programs in BASIC with these modules up to now.
C.
 
Top