> Ahhm, I think he wants to simply read the PIC with a programmer... This code for an F877 will do that. Bear in mind Olin's comment about write endurance for Flash memory. The F877 manual says > 1000 versus > 100,000 for EEPROM. This code was abandoned in favour of external SRAM because Flash couldn't take the number of re-writes required and there wasn't enough internal EEPROM ;================================================ ; Modify flash memory ;================================================ ; data in dlo:dhi ; address to store it in addl:addh writef bank0 ;write modified bytes to Flash bcf pir2,eeif movf addl,w ;get low byte of index bank2 movwf eeadr ;into Flash storage address low bank0 movf add1h,w ;get high byte of index bank2 movwf eeadrh ;into Flash storage address high bank0 movf dlo,w ;data low byte bank2 movwf eedata bank0 movf dhi,w ;data high byte bank2 movwf eedath bank3 bsf eecon1,eepgd ;select Flash bsf eecon1,wren ;start write movlw 0x55 movwf eecon2 movlw 0xaa movwf eecon2 bsf eecon1,wr nop ;don't recall why these NOPs here nop nop nop bcf eecon1,wren bank0 btfss pir2,eeif ;wait for write completion goto $-1 bcf pir2,eeif return ;done -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads