Hi, I'm having a wierd problem writing/reading to the EEPROM on the f877. I wanted to make two routines to write and read, and this is what I came up with: ;Writes the value in W to the address in 'temp' EEPROMWrite bsf STATUS,RP1 ;Switch to bank 2 movwf EEDATA bcf STATUS,RP1 ;Back to Bank 0 movf temp,w bsf STATUS,RP1 ;And back again to Bank2 movwf EEADR ;Set to Bank 3 bsf STATUS,RP0 ;Enable EEPROM Writing bsf EECON1,WREN movlw 0x55 movwf EECON2 movlw 0xAA movwf EECON2 ;Begin Write bsf EECON1,WR bcf EECON1,WREN ;Switch back to Bank 0 bcf STATUS,RP0 bcf STATUS,RP1 retlw 0x00 ;Reads the value at address W and puts it back in temp EEPROMRead ;Switch to bank 2 bsf STATUS,RP1 ;Move the address in W to EEADR movwf EEADR ;Switch to bank 3 bsf STATUS,RP0 ;Start the reading bsf EECON1, RD ;Back to Bank 2 bcf STATUS,RP0 movf EEDATA,w ;Switch bank to Bank 0 bcf STATUS,RP1 bcf STATUS,RP0 ;Move the contents of W to temp movwf temp retlw 0x00 Now what's wierd is that I called the Write fn twice, two different values, different addresses... and then called read on one of them. I read it fine... I then rewrote the code to read the other address (just one at atime), and I got the same thing?? So I'm not sure which fn. is working incorrectly. Anything seem to be wrong with my code? I know it's probably a bit inefficient, but I just want to get it working first. If you guys do'nt see anything wrong with this, I will look a bit closer at my fn to display the numbers on my LCd, but I'm pretty sure that's not the problem since it works for everything else. Thanx, Jai ---------------------------------------- This mail sent through www.mywaterloo.ca -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.