I have, no success. I still get the following error message
Target voltage detected
Target has invalid calibration data (0x00).
Device Erased...
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x1e
configuration memory
program memory
Address: 0 Expected Value: 66 Received Value: 0
Failed to program device
Here is the whole program:
list p=12F509 ; list directive to define processor
#include <p12F509.inc> ; processor specific variable definitions
__CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF & _IntRC_OSC
; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
;***** VARIABLE DEFINITIONS
UDATA_SHR
sGPIO res 1
UDATA
db_cnt res 1
dc1 res 1
;********** RC CALIBRATION
RCCAL CODE 0x3FF
res 1
;**********************************************************************
RESET CODE 0x000 ; processor reset vector
movwf OSCCAL
; Internal RC calibration value is placed at location 0x3FF by Microchip
; as a movlw k, where the k is a literal value.
;****** MAIN PROGRAM
start
clrf GPIO
clrf sGPIO
movlw b'11111101'
tris GPIO
main_loop
banksel db_cnt
db_dn movlw .13
movwf db_cnt
clrf dc1
dn_dly incfsz dc1,f
goto dn_dly
btfsc GPIO, 3
goto db_dn
decfsz db_cnt,f
goto dn_dly
movf sGPIO, w
xorlw b'00000010'
movwf sGPIO
movwf GPIO
db_up movlw .13
movwf db_cnt
clrf dc1
up_dly incfsz dc1,f
goto up_dly
btfss GPIO, 3
goto db_up
decfsz db_cnt,f
goto up_dly
goto main_loop
END