i use the michrochip mplab simulator 5.50 for the 16f628 chip. when writing to the data eeprom, the first access is ok, i.e. a few microseconds after setting the WE bit to 1 (bit 1 in the eecon1 register), this bit is cleared by hardware. the appropriate eeprom byte changes to what i wrote to. then i write the second byte, exactly the same way, then the WE bit stays at 1 forever. what's wrong? this is the code, my compiler generates: 02C5 1283 01171 bcf STATUS, RP0 02C6 1303 01172 bcf STATUS, RP1 02C7 0836 01173 movf param00_EepWrite, W 02C8 1683 01174 bsf STATUS, RP0 02C9 009B 01175 movwf _EEADR_ 02CA 1283 01177 bcf STATUS, RP0 02CB 0837 01178 movf param01_EepWrite, W 02CC 1683 01179 bsf STATUS, RP0 02CD 009A 01180 movwf _EEDATA_ 02CE 151C 01183 bsf _EECON1_, D'2' 02CF 138B 01185 bcf INTCON, D'7' 02D0 3055 01187 movlw D'85' 02D1 009D 01188 movwf _EECON2_ 02D2 30AA 01190 movlw D'170' 02D3 009D 01191 movwf _EECON2_ 02D4 149C 01193 bsf _EECON1_, D'1' 02D5 01195 label_0026 02D5 1683 01196 bsf STATUS, RP0 ---- 02D6 1303 01197 bcf STATUS, RP1 | it always turns here 02D7 1C9C 01198 btfss _EECON1_, 1 | 02D8 2ADA 01199 goto label_0027 | 02D9 2AD5 01202 goto label_0026 ------ 02DA 01203 label_0027 02DA 0008 01204 return thanks tino -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu