hello, The purpose behind the OR's is to prevent the compiler from returning a warning. All functions switch back to bank 0 before returning. I tried clearing both RP's at the beginning of the routine (in case I missed something) but that did not affect my results. Also, everything works fine when simulated in MPLAB. Thanks, Steve Quoting Ken Pergola : > Hi Steve, > > Don't you want 'movwf EEADR' instead of 'movwf EEADR ^ 0x100' ? > > I'm curious about your reasoning behind all of the exclusive ORs with the > special function registers? > It appears to me that the intended SFR addresses are being modified by the > XORs you are performing on the SFR addresses. I'm a bit confused > here...please chime in...I might be missing something. > > Also, on your first bank select (BANK 2) I noticed you have not touched > 'RP1' -- are you sure of the state of RP1 when you enter the routine? > > > Best regards and hope this helps somewhat, > > Ken Pergola > > > > > > > > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of stesquib@MINES.EDU > Sent: Saturday, August 09, 2003 5:04 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC] internal EEPROM trouble > > > Hello, > > Sorry about the lack of detail. I'm sending the data read from the EEPROM > to > an > LCD. I verified that data is written properly by reading the entire chip > through > my programer. I've also inserted the address just before writing to EEADR: > movlw > 0x04 ect. and still I get data from 0x07. The chip is running @ 8MHz from > the > internal RC. > > My read routine: > EEPROM_read > bcf INTCON,GIE ;debug ;interrupts off > movf EEPROM_ADD,w ;save address in w > bsf STATUS,RP1 ;Bank2 > movwf EEADR ^ 0x100 ;load EEPROM_Address > bsf STATUS,RP0 ;Bank3 > clrf EECON1 ^ 0x180 ;point to data memory and clr WREN > bsf EECON1 ^ 0x180,RD ;activate read > bcf STATUS,RP0 ;Bank2 > movf EEDATA ^ 0x100,w ;save data in w > bsf STATUS,RP0 > clrf EECON1 ^ 0x180 ;debug ;drop read bit should be cleared by HW > bcf STATUS,RP0 > bcf STATUS,RP1 > bsf INTCON,GIE ;debug ;ints off > call LCD_Data ;debug ;Display what came out of eeprom > return > > Thx, > Steve > > > > Hi Steve, > > > > Are you at liberty to post some code? It's hard to say what is wrong > > without > > it. > > How are you "seeing" the data read from the EEPROM? Are you using an ICE, > > ICD, LCD, LEDs, serial port? > > Some more details would be helpful. > > > > Regards, > > > > Ken Pergola > > > > > > > > > > -----Original Message----- > > From: pic microcontroller discussion list > > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of stesquib@MINES.EDU > > Sent: Saturday, August 09, 2003 4:28 PM > > To: PICLIST@MITVMA.MIT.EDU > > Subject: [PIC] internal EEPROM trouble > > > > > > Hello, > > > > I'm nearing the end of a project but having trouble with the final > feature. > > this last feature writes and reads data from the internal EEPROM. I have > > verified that data is properly written to the EEPROM. But, no matter what > > address I try to read, I get the data stored in 0x07. I've verified the > > Issue on > > two seperate PIC16F819's and used the same routine on a 16F676. With > proper > > bank > > changes the 676 version works fine. Any ideas about what I may be doing > > wrong? > > > > Always greatfull for any advice, > > Steve > > > > -- > > 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