In my code, I've done the check for end of write on the way in to the write routine instead of on the way out, figuring that I could get other stuff done before I get stuck in a loop waiting for the eeprom write to finish. As I think about it more, though, are reads inhibited until the write cycle is complete? This is the case with the 2816 EEPROM with which I am more familiar. So, maybe it IS a good idea to wait for the write to finish before doing anything that might try to read the eerpom. Harold On Tue, 16 Jan 2001 09:20:01 -0500 Drew Vassallo writes: > You may have also forgotten another line, I can't remember exactly if > it's > required - I haven't used it in a while. Try this: > > bsf STATUS, RP0 ; select Bank1 for EECON > access > bcf INTCON, GIE ; disable interrupts > temporarily > bsf EECON1, WREN ; enable EEPROM write > movlw 0x55 > movwf EECON2 > movlw 0xAA > movwf EECON2 > bsf EECON1, WR ; write values to EE > bsf INTCON, GIE ; reenable interrupts > bcf EECON1, WREN ; disable EEPROM write > Waitforflag > btfss EECON1, EEIF ; poll flag bit > goto Waitforflag > bcf EECON1, EEIF ; write cycle complete > bcf STATUS, RP0 ; leave Bank0 active by > default > return > > --Andrew > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > FCC Rules Online at http://hallikainen.com/FccRules Lighting control for theatre and television at http://www.dovesystems.com ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/tagj. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu