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.