Maybe you could tell us (or show us) *why* you expect EEDAT=0x36 and EEDATH=0x1B to be returned. And, as Jinx pointed out, you'd better save the EEDAT value in W, before writing it over with the EEDATH value. But, using MPSIM you should be able to view the two values anyway... Jan-Erik. > -----Original Message----- > From: piclist-bounces@mit.edu > [mailto:piclist-bounces@mit.edu]On Behalf > Of Michael L. Ervin > Sent: den 26 mars 2006 10:47 > To: Microcontroller discussion list - Public. > Subject: [PIC] "Flash Program Memory" read problems > > > I have the following code that I'm using on a PIC 16F690 > processor. This code was copied from the PIC 16F690 documention. > This code SHOULD read a program memory word from location > 0x0074. However, it keep returning EEDAT=0xFF and > EEDATH=0x00 instead of EEDAT=0x36 and EEDATH=0x1B. > > My configuration bits are defined as: > > __config (_INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_OFF & > _MCLRE_OFF & _CP_OFF & _IESO_OFF & _FCMEN_OFF) > > > Has anyone else run into this issue? > > Thanks, > Mike > > > bcf STATUS,RP0 ; select bank2 > bsf STATUS,RP1 > movlw 0x0 > movwf EEADRH > movlw 0x74 ; address of program memory > movwf EEADR > bsf STATUS,RP0 ; select bank3 > > bsf EECON1,EEPGD ; read the data > bsf EECON1,RD > > nop > nop > > bcf STATUS,RP0 > movf EEDAT,W > movf EEDATH,W > bcf STATUS,RP1 > -- > 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