MicroMag 2-axis compass and Arduino Duemilanove?

Hello!

I am trying to get the MicroMag 2-axis magnetometer to work with an Arduino Duemilanove, but to no success. I have mainly tried following the example provided by Daniel Soltis (http://itp.nyu.edu/physcomp/sensors/Cod … MagArdTest) but it doesn’t give me any results.

Just to see if anything happened, I attached LEDs to all wires going in and out of the compass. They blinked when they should, but there was no data to be read from the compass.

I have also searched for help on working with SPI and Arduino, and found a library which didn’t help me much. In the documentation for Duemilanove, it says that there are ports ready to be used for SPI communication, and even though the hardware supports it, the software doesn’t(?) Does that mean that Arduino as programming language doesn’t have the SPI protocol implemented yet?

It seems like Daniel’s example is the only one regarding the MicroMag magnetometer out there. It is for the 3-axis version, but after reading the documentation for the 2-axis version, there doesn’t seem to be enough differences between them to make the example not working.

Based on what I’ve learned from reading code here and there, and re-reading the documentation over and over againg, I tried writing my own code following the documentation. But that didn’t help either.

Does anyone have any experience using these magnetometers with Arduino?

Can you believe this? It started working.

As a last desperate try, I moved the wires from the SPI ports on the Arduino (11, 12, and 13) to 8, 9 and 10. And that’s it.

Conclusion: don’t use Arduino’s SPI-ports.