While waiting for my new RTC module to arrive and having had first I2C success reading it, I ventured a step further..
I hooked up my new Compass Module GY-273 which was supposed to be a HMC5883L
Since i found some code on the Net I figured - piece of cake - set the adress, read in the variables and ready...
No GO!
I just get zeros, no data for x,y or z.
sertxd:
:2 x:0 y:0 z:0 temp:0
t:4 x:0 y:0 z:0 temp:0
t:6 x:0 y:0 z:0 temp:0
t:8 x:0 y:0 z:0 temp:0
t:10 x:0 y:0 z:0 temp:0
t:12 x:0 y:0 z:0 temp:0
Asking Dr. Google I found out that the chip is probably a QMC5883L and that it has a different adress & registers from the original.
I even found a Datasheet, with a lot of Info. --> here: http://qqtrading.com.my/index.php?route=product/product/download&product_id=195&download_id=21
From what I could decipher:
I2C Adress = 0x0D - that would be $1A (ok?? either shift left or multiply by 2 ? - found that in some snippets)
Compass data registers: 00 -> 05
Temp registers 06 & 07
The adapted code:
The more i read the more I realize, that there is a lot to be learned...
How do i write the config registers
where do i specify the starting point for reading registers ..
Greetings
Mike
I hooked up my new Compass Module GY-273 which was supposed to be a HMC5883L
Since i found some code on the Net I figured - piece of cake - set the adress, read in the variables and ready...
No GO!
I just get zeros, no data for x,y or z.
sertxd:
:2 x:0 y:0 z:0 temp:0
t:4 x:0 y:0 z:0 temp:0
t:6 x:0 y:0 z:0 temp:0
t:8 x:0 y:0 z:0 temp:0
t:10 x:0 y:0 z:0 temp:0
t:12 x:0 y:0 z:0 temp:0
Asking Dr. Google I found out that the chip is probably a QMC5883L and that it has a different adress & registers from the original.
I even found a Datasheet, with a lot of Info. --> here: http://qqtrading.com.my/index.php?route=product/product/download&product_id=195&download_id=21
From what I could decipher:
I2C Adress = 0x0D - that would be $1A (ok?? either shift left or multiply by 2 ? - found that in some snippets)
Compass data registers: 00 -> 05
Temp registers 06 & 07
The adapted code:
Code:
symbol x = w0
symbol y = w1
symbol z = w2
symbol T = w3
hi2csetup i2cmaster, %00011010, i2cslow_32, i2cbyte ;
hi2cout 0, ( %00010000 ) ; Don´t know if req.
hi2cout 1, ( %00100000 ) ; Don´t know if req.
hi2cout 2, ( %00000000 ) ; Don´t know if req.
Do
hi2cin 3, ( b1,b0 , b3,b2 , b5,b4 ) ; also tried 0
hi2cin 7, (b6,b7);
sertxd ("t:",#time," x:",#x," y:",#y," z:",#z, "temp: ", #T, CR,LF)
loop
The more i read the more I realize, that there is a lot to be learned...
How do i write the config registers
where do i specify the starting point for reading registers ..
Greetings
Mike