Hello, I'm experimenting with the EEPROM of a PIC16F88. At the minute I'm trying to write an arbitary value to an address in the EEPROM. However I'm seeing the " error: left operand must be l-value" error message. I have a vague idea that this is something to do with trying to assign a variable to a constant(first two lines in my eeprom_write function) but i'm stumped on as how to get around it. The code I have written using sourceboost is:
Currently I just want to write values to the EEPROM, simulate the progam and check for correct operation. Any help is appreciated, thanks.
Rich (BB code):
void eeprom_write()
{
EEADR=01111011b; //write address to EEADR
EEDATA=01110001b; //write 8-bit data value to EEDATA
eecon1.7=0; //access data memory
eecon1.2=1; //allow write cycles
intcon.7=0; //temporarily disable interrupts
eecon2=01010101b; //write 55h to eecon2
eecon2=10101010b; //write AAh to eecon2
eecon1.1=1; //Initiates a write cycle
intcon.7=1; //re-enable interrupts
eecon1.2=0; //Inhibits EEPROM writes
while(pir2.4==0)
{
nop(); //wait for write to complete
}
pir2.4=0;