I2C / EEPROM Problem
Posted: 01 Oct 2010 12:49
I've started trying to get an EEPROM on a I2C-line working.
The development board I use is an LV 24-33A with PIC24FJ96GA010 MCU.
I have a program where I utilize the touch screen with pretty much the same code as the touch panel example. I want to try and save the calibration data to EEPROM, but apparently it doesn't work all that well.
The code I'm using for writing / reading to/from eeprom is as follows:
As soon as I run that code, my touch panel won't response at all (probably because the calibration values somehow have become corrupt). Which is kinda weird, because in it's essence, that code snippet shouldn't change the calibration values at all.
Anyone know what could be wrong?
I've modified the Eeprom library slightly (changed I2C_Start to I2C1_start etc.) to match my setup.
The development board I use is an LV 24-33A with PIC24FJ96GA010 MCU.
I have a program where I utilize the touch screen with pretty much the same code as the touch panel example. I want to try and save the calibration data to EEPROM, but apparently it doesn't work all that well.
The code I'm using for writing / reading to/from eeprom is as follows:
Code: Select all
EEPROM_WrSingle(0x02,cal_x_min);
EEPROM_WrSingle(0x03,cal_y_min);
EEPROM_WrSingle(0x04,cal_x_max);
EEPROM_WrSingle(0x05,cal_y_max);
Code: Select all
cal_x_min=Eeprom_RdSingle(0x02);
cal_y_min=Eeprom_RdSingle(0x03);
cal_x_max=Eeprom_RdSingle(0x04);
cal_y_max=Eeprom_RdSingle(0x05);
Anyone know what could be wrong?
I've modified the Eeprom library slightly (changed I2C_Start to I2C1_start etc.) to match my setup.