- Wed Feb 06, 2008 9:08 am
#42351
I just bought a MicroMag 3-axis SPI module at SparkFun..
I hooked it up to a dsPIC30 with DRDY pin to an external hardware interrupt , SPI runs at just below the 1MHz MicroMag limit.. Every three measurements I print the numbers to a COM terminal to observe them...
Numbers flush down the screen in my terminal window. They are formatted by the two bytes the MicroMag returns after DRDY triggers high by the formula: Mag[axis] = (int)(0x100 * Hbyte) | (int)Lbyte, showing up as integers from 0 to 65535..
This is where things become unclear for me.. The data sheet states 2's compelement, but when I convert to signed and take the sqaure of the components, that number varies much as I turn the sensor around so obviously I need to do something else..
I do not need to convert the units to gauss or tesla. All I need is the square of all components to be constant, so I can calibrate a length for that magnetic vector. I need it to be a scalar of the magnetic vector.
The data sheet is a bit confusing on the calculations (my device is 5V powered. I cannot figure out what resistor the data sheet denotes Rb at recommended 75 ohm with 5V, numbers in datasheet are calculated based on 3V... and so on). Also, I was a bit disappointed about speed performance. Albeit I only skimmed the datasheet before purchasing the sensor, but it showed excellent data on update rate and sensitivity, too bad you can't get both but have to choose..
I hooked it up to a dsPIC30 with DRDY pin to an external hardware interrupt , SPI runs at just below the 1MHz MicroMag limit.. Every three measurements I print the numbers to a COM terminal to observe them...
Numbers flush down the screen in my terminal window. They are formatted by the two bytes the MicroMag returns after DRDY triggers high by the formula: Mag[axis] = (int)(0x100 * Hbyte) | (int)Lbyte, showing up as integers from 0 to 65535..
This is where things become unclear for me.. The data sheet states 2's compelement, but when I convert to signed and take the sqaure of the components, that number varies much as I turn the sensor around so obviously I need to do something else..
I do not need to convert the units to gauss or tesla. All I need is the square of all components to be constant, so I can calibrate a length for that magnetic vector. I need it to be a scalar of the magnetic vector.
The data sheet is a bit confusing on the calculations (my device is 5V powered. I cannot figure out what resistor the data sheet denotes Rb at recommended 75 ohm with 5V, numbers in datasheet are calculated based on 3V... and so on). Also, I was a bit disappointed about speed performance. Albeit I only skimmed the datasheet before purchasing the sensor, but it showed excellent data on update rate and sensitivity, too bad you can't get both but have to choose..