Ok I checked out that info, thanks, I also found that bank problem while simulating in mplab, I wondered why that was. I looked over the new data and see that to set write enable they are sett= ing EECON, WREN is this right? I thought it should be EECON1, WREN i included the section from the data sheet, the other thing that gets me with this i= s they use 0AAh, the compiler doesn't like this, I have been using 0xAA, is that all right? Other then that I use much the same code, is it OK to loa= d the data into EEDATA before the address value into EEADR, because thats something else that I have done differently. This problem is driving me nuts, thanks for the help. EXAMPLE 13-2: DATA EEPROM WRITE ; set up the data and the address BSF STATUS, RP0 ; Bank 1 MOVLW CONFIG_ADDR ; MOVWF EEADR ; Address to write MOVLW CONFIG_DATA ; MOVWF EEDATA ; Data to write ; perform the write operation BSF EECON, WREN ; Enable Write BCF INTCON, GIE ; Disable INTs MOVLW 055h ; MOVWF EECON2 ; Write 55 MOVLW 0AAh ; MOVWF EECON2 ; Write AA BSF EECON1, WR ; Set WR bit BCF STATUS, RP0 ; Bank 0 ----- Original Message ----- From: Niklas Wennerstrand To: Sent: Tuesday, August 14, 2001 12:44 PM Subject: [PIC]:trouble writing to eeprom on 16f628 A possible solution to your problem with EEmemory is that there is a printing error in the 16F628 data sheet. The instruction on how to read and write to the internal Eememory is copy= ed and pasted from the PIC16F84 data sheet. And therby you write to the wron= g bank in 16F628. Eeread and Eeaddress is shifted from a F84. Have a look a= t the memory SFR table in the 16F628 data sheet and you see what I mean. I think there is an errata where this printing error is documented. Look at www.microchip.com under literature and errata document. Niklas Wennerstrand -----Ursprungligt meddelande----- Fr=E5n: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.ED= U] F=F6r PD Skickat: den 14 augusti 2001 23:42 Till: PICLIST@MITVMA.MIT.EDU =C4mne: Re: [PIC]:trouble writing to eeprom on 16f628 Thanks for your reply, I can't seem to find any reference to this in the data sheets, all I can see is the write enable bit in a data register, bu= t nothing mentioned in the config word. Could you give me an example of the config word that I should use, I use mplab so I normally don't even use a config word, this could be my problem right there. ----- Original Message ----- From: Heinz Czychun To: Sent: Tuesday, August 14, 2001 10:56 AM Subject: Re: [PIC]:trouble writing to eeprom on 16f628 > Hi Chris, > > I don't have any code, but have you checked the EEPROM > protect bit ( Bit 8 should be 1 ) in the config word? > > Heinz > > At 12:39 PM -0700 8/14/01, PD wrote: > >Has anyone seen any examples that shows a routine to write multiple > >ram locations to the eeprom, it would help me greatly. > > > >Thanks for any ideas on this. > > > >Chris > > ----- Original Message ----- > > From: PD > > To: PICLIST@MITVMA.MIT.EDU > > Sent: Monday, August 13, 2001 2:25 PM > > Subject: [PIC]:trouble writing to eeprom on 16f628 > > > > > > I have followed the Microchip examples and still can't get this to > >work, I can read from the eeprom with no problems but can not get it > >to write. I created a routine to read some values from the eeprom to > >the RAM at the start of the program and then if the user changes any > >values during use they are then written from RAM to the eeprom. If > >I simulate it in MPLAB it works fine, I can provide examples of my > >code if that helps any. > > > > Thanks > > Chris > > > >-- > >http://www.piclist.com hint: To leave the PICList > >mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu