I finally got it to work. First MPLAB shows changes to EE only after the program has been paused or stopped. Second, I had to poll for the EEIF flag and weight until it was set to do the next write. The data sheet does show how to do the writes and does talk about EEIE and EEIF but doesn't say that one of them must be used to weight for the write to finish before the next write. The sample code doesn't show it either. I had taken my EE write code straight of the data sheet too. Anyway thanks for your help. ----- Original Message ---- From: alan smith To: Microcontroller discussion list - Public. Sent: Monday, November 3, 2008 8:07:01 PM Subject: Re: [PIC] EEPROM won't change You either need to use the interupt to determine when the write is complete, or add a delay to ensure the write completes. Refer to the data sheet where it details exactly how the write sequence occurs. --- On Mon, 11/3/08, Hasan Khan wrote: > From: Hasan Khan > Subject: [PIC] EEPROM won't change > To: "PIC List" > Date: Monday, November 3, 2008, 6:35 AM > Hi, > I have a project where I need to write some constant values > into eeprom of a 16f84a. I am writing the code in mplab and > testing it on its simulator. This code won't work > because simulator shows no change in eeprom values or the > registers EECON1 and EECON2. It does show EEDATA and EEADR > changin. Here is the simplified code. Thanks for any help. > > #include p16f84a.inc > > list p=16f84a > > org 0x00 > > ;initialize EEPROM > banksel EEDATA > movlw 0x34 > movwf EEDATA > movlw 0x01 > movwf EEADR > > bsf STATUS, RP0 ; BANK 1 > bcf INTCON, GIE > > bsf EECON1, WREN ; Enable Write > movlw 0x55 > movwf EECON2 ; Write 55h > movlw 0xAA > movwf EECON2 ; Write AAh > bsf EECON1,WR ; Set WR bit > > bsf INTCON, GIE > bcf STATUS,RP0 ; BANK 0 > > end > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist