I've been having problems programming the internal EE area on the 16C84. My code follows the sequence 0xaa, 0x55 etc as described in the data book. I'm using a picmaster emulator system. When using the emulator it all works fine, the data is stored and retrieved as would be expected. When I burn the chip it fails to work. I can easily tell if the programmed values are within the correct range from the response of the target application. I also use a Universal Xeltec programmer, with this I can pre-program values into the EE that I know are in the correct range. When I do this it all works fine. That is the chip is reading the values out of the eeprom properly. When I let it write the new values they are random in value but written over the correct address range, the rest stay zero. Originally I was using looping until the complete flag had come up. I've also tried simply waiting the required delay but I still get incorrect values. Also tried different chips to see if the ee area on the chip itself was at fault, unlikely I feel, no luck there either all three chips behaved the same. Here is a portion of the code in two parts macro and eewrite subroutine. {macro write_ee} WRITE_EE MACRO ADR, DAT movlw ADR movwf EEADR movf DAT,W movwf EEDATA call Write_EEProm ENDM {Subroutine Write_EEprom} Write_EEProm: PAGE1 ;Macro, move to page 1 bcf EECON1-0x80,WRERR bcf EECON1-0x80,EEIF movlw 0x55 movwf EECON2-0x80 movlw 0xAA movwf EECON2-0x80 bsf EECON1-0x80,WR Wait_EEProm: btfss EECON1-0x80,EEIF goto Wait_EEProm bcf EECON1-0x80,WREN PAGE0 ;Macro, back to page 0 return I would appreciate any suggestions you could offer. Many Thanks Shane Email: goweed@hotmail.com ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com