I've been working to try and get some readable data from an IMU for awhile now (MPU-6050) but I've run into a really strange problem where it seems a defined value is changing.
This is causing all the code to not work because the value that's changing is the TWIE address on my XMEGA. (line 8 #define MPU_TWI &TWIE in mpu.h).
When I pause the program that's running, the port* value will be reported as 0x02a0 or 0x00a0 instead of the 0x04a0 that it should be.
I get the feeling it's probably the TWI code (See lines 42-46 of twi.c) doing some funky things so I'm going to use the atmel provided TWI example code and rewrite the MPU code to work with it instead, but I figured it might be worth it to post what I have here and see if someone might be able identify a silly mistake before I go about doing that.