I am building a project for a micro controller class and have run into a problem. I want to build an electronic compass, but all the magnetometers I can find use the I2C protocol to communicate with the controller, however the controller I am required to use only supports SPI (I think this engineering class has been using the same micro for the last 20 plus years). I have learned how to use SPI in the class, but know little about I2C.
So, my questions are:
Is there a good way to convert the I2C output of the magnetometer to SPI so my controller can handle it?
or
Is anyone aware of a magnetometer currently on the market that supports SPI?
or
Is it possible to set up the SPI on my micro to get the data from an I2C directly? (I’m not holding my breath for this one)
or
Should I just build something else that uses hardware my micro can handle? (I can still change my mind about what I am going to build.)
Any advice on any of these points would be appreciated.