I have a new board, that updated the processor from an 16F877 to a 18F45K22= , porting the code over. =20 However I ran across something that I haven't been able to really identify = whats going on here. =20 This is a standard piece of code I use all the time with the 18F parts, and= up to now I haven't seen any problems. I'm using a ICD3 but not the latest version of MPLAB...its new enough to kn= ow what this part is of course, and builds Without any issues. However I found that when I write to the EEPROM, data = isn't getting in there so I put up a watch Window and single stepped thru the code. First off, the EEADR and EEDATA are not getting written to. Next, the sequence of clearing and setting bits in the EECON1 register ..th= is works. The WREN bit gets set. Then the magic sequence...doesnt get written to the EECON2 register IF I push the values into the registers thru the watch window, indeed I can= get the values written to the Desired address. What I find interesting is setting an individual bit works, but moving a by= te in..doesnt. This routine works...Ive used it on several 18F parts, and verified in the = data sheet..ie...the example code,=20 Is the same as well. =20 Any thoughts...why these SFR's are not being written to? Has to be somethi= ng simple but after looking at it and=20 Not seeing anything, just wonder if I am overlooking something ? EEPROM_WRITE BANKSEL EEADR movf EEPROMaddr,w movwf EEADR movf EEPROMdata,w movwf EEDATA bcf EECON1, EEPGD bcf EECON1, CFGS bsf EECON1, WREN bcf INTCON,GIE ;disable interrupt movlw 0x55 movwf EECON2 movlw 0xAA movwf EECON2 bsf EECON1, WR bsf INTCON,GIE ;re-enable interrupt - if interrupt is being used eewait btfsc EECON1,WR ;are we done? wait here till we are goto eewait bcf EECON1,WREN return Confidentiality Notice: This e-mail message, its contents and any attachmen= ts to it are confidential to the intended recipient, and may contain inform= ation that is privileged and/or exempt from disclosure under applicable law= .. If you are not the intended recipient, please immediately notify the send= er and destroy the original e-mail message and any attachments (and any cop= ies that may have been made) from your system or otherwise. Any unauthorize= d use, copying, disclosure or distribution of this information is strictly = prohibited. Email addresses that end with a ?-c? identify the sender as a = Fusion-io contractor. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .