MPLAB ICD2 Problem

Status
Not open for further replies.

jkashiwada

New Member
Hello,

This is my first post, Hopefully someone will be able to help me. I just got my first programmer, a clone of the MPLAB ICD2 (serial) from tekdevice on ebay. I wanted to test it on a PIC16F88 that i had. I plug it in and start up MPLAB and connect to the ICD2. It recognized it, loaded a new OS, and occasionally detects the pic in the ZIF socket.

When I try to program the PIC, i get the following:

MPLAB ICD 2 ready for next operation
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to MPLAB ICD 2
Target Device PIC16F88 found, revision = Rev 0x8
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 ready for next operation
Erasing Target Device...
...Erase Succeeded
MPLAB ICD 2 ready for next operation
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x20 - 0x27)
Verifying...
...Program Memory
ICD0161: Verify failed (MemType = Program, Address = 0x20, Expected Val = 0x1683, Val Read = 0x86)
ICD0275: Programming failed.
MPLAB ICD 2 ready for next operation

Can anyone help me figure out why i get "verify failed"?

my code is short, just wanted to test if i could program the pic. Could there be errors here too? Any help would be greatly appreciated.

;code

LIST p=16F88 ; list directive to define processor
#INCLUDE <P16F88.INC> ; processor specific variable definitions

;------------------------------------------------------------------------------
__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_OFF & _INTRC_IO
__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF

;------------------------------------------------------------------------------

org 0x0020

Begin
BANKSEL TRISB
MOVLW b'00000000'
MOVWF TRISB
BANKSEL PORTB
MOVLW b'00000001'
MOVWF PORTB


END
 

in case when you are using INTRC_IO, perhaps you need to have a facility like Vpp before Vdd. other wise, as you power it, the internal clock starts working and there is no way to stop and bring it to program,ming mode.
Initially , it would be better to work with XT mode of crystal oscillation with 4MHz, learn to some extant. later we can think how to use INTRC_IO mode and with icd2.
 
I've used the RC oscillator with the ICD2 many times before, and never had a problem like that. It was with the 18F series, so maybe the 16F is different?

I would suggest trying a different PIC to see if you get the same error. Also, do you have .1uf capacitors on the power and ground pins close to the PIC?
 
jkashiwada]It recognized it said:
occasionally[/COLOR] detects the pic in the ZIF socket.
Check that Vpp is going to apx 13V during programming.
in case when you are using INTRC_IO, perhaps you need to have a facility like Vpp before Vdd.
Shouldn't need that because he has _MCLR_ON
If he had _MCLR_OFF and INTRC_IO then the above would be true.
 
Hi Guys,

I tried a different pic 16f887 and now I am no longer getting that error. However, now I have a new problem...Not sure if it belongs in here though.

I am using assembly, and eventually want to hook up a keypad and smart lcd to the pic. To get started I just wanted to play with inputs and outputs. Does this code look okay? it's supposed to set RD7 - RD4 high if RD3 - RD0 are high. When plugged into the circuit I get nothing... any suggestions?

LIST p=16F887 ; list directive to define processor
#INCLUDE <P16F887.inc> ; processor specific variable definitions

;------------------------------------------------------------------------------
__CONFIG _CONFIG1, _CP_OFF & _DEBUG_OFF & _CPD_OFF & _LVP_OFF & _BOR_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _INTOSC
__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF

;------------------------------------------------------------------------------


Begin
clrw
BANKSEL PORTD
movwf PORTD
BANKSEL TRISD
MOVLW b'00001111'
MOVWF TRISD
Loop
BTFSC PORTD,0
goto zero_set
BTFSC PORTD,1 ;test if bit one is high
GOTO one_set
BTFSC PORTD,2 ;test if bit two is high
GOTO two_set
BTFSC PORTD,3 ;test if bit three is high
GOTO three_set
goto Loop

zero_set ;bit zero on port D is set. light up bit4 to indicate this
movlw b'00010000'
movwf PORTD ;sets bit 4 to high
goto done

one_set ;bit one on port D is set. light up bit5 to indicate this
movlw b'00100000'
movwf PORTD ;sets bit 5 to high
goto done

two_set ;bit two on port D is set. light up bit5 to indicate this
movlw b'01000000'
movwf PORTD ;sets bit 6 to high
goto done

three_set ;bit three on port D is set. light up bit5 to indicate this
movlw b'10000000'
movwf PORTD ;sets bit 7 to high
goto done

done
goto Loop
end


END
 
You are accessing PORTD in bank 1.

Code:
Begin
		clrw
		banksel	PORTD		;[COLOR="red"]bank 0[/COLOR]
		movwf	PORTD
		banksel	TRISD		;[COLOR="Red"]bank 1[/COLOR]
		movlw	b'00001111'
		movwf	TRISD
Loop
		btfsc	PORTD,0		;[COLOR="red"]woops[/COLOR]

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…