void EEPROM_Write(unsigned int *address, unsigned char eeprom_data) // call function, with two input values, the address in which to write and the data to write to it
{
EECON=0x02;	//Enable EEPROM
*address=eeprom_data;	//Latch the data
EECON=0x52;	//Programming  -- I tried both
EECON=0xA2;	//Sequence     -- x4 and x2
Delay(5);		//Delay to give the EEBUSY time to rise
while(((EECON&0x01)==0x01));		//Wait till EEBUSY is off
EECON=0x00;				 //Disable EEPROM
}

char EEPROM_Read(unsigned int *address) // //call the function and specify the needed address 
{
unsigned char eeprom_data='5';  //I set the EEPROM_Data to the char 5 to test if it even gets changed
EECON=0x02;	//Access EPROM
AUXR=0x2C;	//Extend the Read cycles to accomidate for slow memory
eeprom_data=*address;  //write to eeprom_data the value stored at the needed memory
EECON=0x00;	//Allow usage of EPROM
AUXR=0x0C;	//Restore normal R/W Cycles
return(eeprom_data);						  
}
