LIS3MDL compass module locking up issue

I am controlling this device with a Microchip 18F microcontroller. It reads ok until the compass is rotated where the X-axis reaches max value then locks up communications. Had the same sort of issue with the Honeywell HMC5883L device but locked up when rotating the X-axis crossed the zero value. Going crazy with this problem and seeking help. Thanks!

Hello, Frank.

I am sorry you are having trouble using the LIS3MDL. We have not heard of problems like that before, so I suspect that there is a problem somewhere in your code or setup. If you simplify your system and then post all the relevant details about it, then we might be able to see what the problem is. Be sure to include pictures, a wiring diagram, the names and item numbers of the specific Pololu products you are using, simplified code that should work but still exhibits the problem, and specific details of what you are observing. As a first step to simplifying the code, I would recommend removing any code that processes the magnetometer readings and instead just have your code print out the raw values. You can see more tips about troubleshooting and how to ask for help on our Support page.