Hi All,
I'm using Code Composer Studio v5.5, with the stellaris board LM4F120.
I've been developing a project since before Christmas on this board, and have not had any issues previously (other than minor human mistakes and the standard beginner compiler/linker mistakes).
The part of the project I'm now developing involves using the I2C interface on I2C1, with several different chips. I'm using a driver, found in these forums (http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/236184.aspx), which I've had to modify a bit to get to work with my versions of the I2C.h file. I have tested this with an MPU6050 tri-axi accelerometer and gyroscope, and have found I can read values(what they are isnt important, but they change when I move the sensor in a repeatable fashion), which suggests to me that I am using I2C correctly. I then proceeded to add an extra API to handle 16-bit addressing to an EEPROM device (24AA64).
I then successfully wrote and read to the addresses: 0x0000 and 0x0001. However, upon trying to write to 0x0002, the write method returns no errors, but a read to that same address returns 0xFF - the initial state of the EEPROM. On closer inspection of the registers in debug mode, I find that the 'I2C_0_MDR' register is not being modified by the write function. I had not altered the API or I2C.c file in any way between trying to write to 0x0001 and 0x0002. I have power cycled, flash erased the LM4F, and each time I read 0xFF. One theory I had was that the EEPROM, with an internal address pointer was responding to these blank reads by sending the value of the next address - as per the datasheet, though I not sure if this is possible after a power cycle. I disconnected the I2C wires from the bus, and tried simply to function call I2CMasterDataPut(), with my own values. These had no affect on the I2C_0_MDR register.
I tried using the HWREG() command, found within the I2C.c driver and again no luck. I then initialised I2C2, but found I could not alter the MDR register there either.
Furthermore, I've noticed that when setting breakpoints in the code, and running, it will now often simply skip those breakpoints. I re-upload, delete all breakpoints and try adding them again, but nothing I do can force the program to stop at these breakpoints. I am really at a loss to explain all of these happenings. The only alteration I can think that I have made recently is unsuccessfully trying to add the UARTStudio.h file in, though not sure why this would break everything.
Any ideas as to things to try to fix this would be appreciated. I am convinced that the code is simply skipping the functions calls to "HWREG(I2C2_BASE + I2C_O_MDR) = ui8Data;" - why would it do that? Why do my breakpoints not attach?
Cheers