Jeethu Rao wrote: > > Here is the EEPROM Read code found on > Page 93 of the 16f628 data sheet. > > BCF STATUS, RP0 ; Bank 0 > MOVLW CONFIG_ADDR ; > MOVWF EEADR ; Address to read > BSF STATUS, RP0 ; Bank 1 > BSF EECON1, RD ; EE Read > BCF STATUS, RP0 ; Bank 0 > MOVF EEDATA, W ; W = EEDATA > > Everything seems fine except for the last line. > The register map shows that EEDATA is in Bank1. > So reading EEDATA would actually read RCREG! > > Is this an error in the data sheet ? Yes, this is what I use, assuming EEADR is set already... RdEep bsf STATUS,RP0 ; RAM Page 1 bsf EECON1,RD ; read EEPROM movf EEDATA,W incf EEADR ; set for next sequential read bcf STATUS,RP0 ; RAM Page 0 return > I guess they merely copied the routine from > The 16f84 data sheet. How misguiding this could > be to newbies! A big headache no doubt. Report it to Microchip. I have done so in the past for this data sheet and got an immediate fix. -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics